From patchwork Tue Jan 23 11:03:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charan Teja Kalla X-Patchwork-Id: 13527250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 246EBC47DDC for ; Tue, 23 Jan 2024 11:04:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9112D6B007E; Tue, 23 Jan 2024 06:04:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C1926B0080; Tue, 23 Jan 2024 06:04:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 761806B0081; Tue, 23 Jan 2024 06:04:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6134D6B007E for ; Tue, 23 Jan 2024 06:04:06 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3E9D740A6A for ; Tue, 23 Jan 2024 11:04:06 +0000 (UTC) X-FDA: 81710291292.21.C8D255D Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf12.hostedemail.com (Postfix) with ESMTP id DAE6040020 for ; Tue, 23 Jan 2024 11:04:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=p6xYMsIK; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf12.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706007844; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=ep+LJJCGCPOiBkIso0GxeydK6txy6MfI/exTM73RNrI=; b=bvrhvfaCdqzB69H2Gy83Bry1dRttpVDVF1Z/cl0QgKK2J0zcQaNn5hrjbVgpLDia0cm9gp XCRo0hZ/Z/DTz6uR7ylSyPGAyXaV1iUm+4HQIr7fe2t7ojr0/2Br7tPce3gPjWQREb+von 4fQR0j9UEQwnH29BQhnr2U+qnElb6Aw= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=p6xYMsIK; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf12.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706007844; a=rsa-sha256; cv=none; b=XCctULd5A5XBO7+xsYSIuLw41Rm990B2tuhHTKSd1URYRYD0Vsq72HVl3vxo8WmGQJIT7x bU1LYwpYtuPCJldO7e6+pCOD+pXJuQoDrK42TKTc+vnn5w3ePv/D+1Gr7ISYUbZVq1PasC f9ZutWsYSlyt76uU8I4ZqLIs7ush9Ro= Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40NAEF0T024765; Tue, 23 Jan 2024 11:03:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:from:to:cc:subject:content-type :content-transfer-encoding; s=qcppdkim1; bh=ep+LJJCGCPOiBkIso0Gx eydK6txy6MfI/exTM73RNrI=; b=p6xYMsIKphvCwTjSyT3TWEty4p2cL3XF3Sr0 /hEKPkGWDBBRBaH9hHvBzE59N1fSoBHv6Dv7Nhsyq9jeai/bk2NSiE4I9rxKiQ1Q Z0GofyBhCLC4nyIcu3LE1ZR4z4KsebRUFFllJ5NcICo48CZ03lqtcDaV6s12lEnH jB0SU7EUXt+wnep2X5O2vXkJ45bU/r9C7KhzGmPy+JcZ5JeL/i2rERtHaMj7tWJz Mw3p8rEp0Rmk0sik/hPuxTYEJ0z39yInShUdas9AEv9YpvSlCDXTPC81BHzvD93V IqIgJ0IBoppuzt9Y4kMaFvHBeSWcW0nYQTj/lmW+sOED39/sKQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vt8140jd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 11:03:57 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40NB3uKU028388 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 11:03:56 GMT Received: from [10.214.66.119] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 23 Jan 2024 03:03:54 -0800 Message-ID: <56154bf4-c1e2-16d5-c6e2-c2dee42d3377@quicinc.com> Date: Tue, 23 Jan 2024 16:33:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US From: Charan Teja Kalla To: , Matthew Wilcox CC: "linux-mm@kvack.org" , LKML Subject: Purpose of maple_node objects to be its size aligned X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: hCX1sMD41WRuH3wU0PexQVokd9gePt1y X-Proofpoint-ORIG-GUID: hCX1sMD41WRuH3wU0PexQVokd9gePt1y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-23_05,2024-01-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxlogscore=998 clxscore=1011 impostorscore=0 malwarescore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401230080 X-Rspamd-Queue-Id: DAE6040020 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: epxd1kpicdtnc3xx79xezbosg8hr3m6f X-HE-Tag: 1706007843-42105 X-HE-Meta: U2FsdGVkX19xeOEPgPn+psvJCJGb5zG2CixQaqEIHmMJ769o+2Q7oVgK6czXjgBvjcW+GbuvNFgNHc4epIZCWGACFzqYKgrE891xe5ZY4BBpynztf6lsGnXqJFy6SmbKF+y+sl1bePzCT4+6tZ7DOlF7gbKTclVzl93hEi7Ju5Ki64XqVem1Qx4HFbeNK4G+7/f5Qh2ufApPAkAVGskNBAVuKNnc7AwVhRNFCFclmWYNBPfdo8ExDzml0NZfbe+8YjcmEWgjx524adK1wMHyn361iEqDAujWchaZo14yVNXiDfbXpnm+C2EEVoQRNzPHfAUFAA+rpY82iHM/3JdRuLkoqOQP4+//39xorfFrtJFt7mFjUe3WZMLLJ/LpfyAe9Tx6QkcucsgMp3agprxAEtDP9XJGpLfvbjVyaucsj0vOqiFPYu98D24QLvVaglFZxi8ukwRMvTW7IhgJjIkQE3RFJFpeMA3MGDgxm6hVRsz9WBr6HYg3DiiU5XysSpuyE3cSpTIY7jyg5jcMaHVrXb1pMJQ+5V90DQOxX5OAt16WKmAsuzORVghz732zL5p4N7r6lAuSDdApCmLBAcKJP9m5KZtKQjFZSukV7JcFyuOPbHi5hjyA1ZeuTJJv4kwwuOLlnOv3inMHUPp0LyIIKGyjTQK6r29BkW1VJ+r1d7rpFzoUmrQi/v61URwJ5iHSp8icwTx/zAPWmbLn72JhPROEdzwjzyC9Wy2hM9vOqxVyUFI9jjGohKCbTeVWkcqYKqneppqzRdMGGnXUG5Ke87Rh3tisg7dSSJTbv06fbK/MS6+iNON90BuduCJXotsoLfQD/sufgUVfWp+LvvcoPZT6qnpVjKBwsv6ANWqiq1SxGy0dHLzR1cXUJpsf3/aYLOtQB0Dc8MAVNDDbW6ZRRCKs7gpvP9nWCwTvArO1390NEQy+D4k2ArC+Ry44jF29YghANOA4X8QzmXuejgz P2cjS0up IjEBO3BBJy1WXLuuD1ViKLDYUTrGWhr8/zCIaSfeoKbQiz9uDKXhm9jlCL3g6kljuyMgiKjZX5DshQLl+1Z+qQSBfXpCh87l5QVCn+3j5hjHRuC5CK2TcXXNFyGqsgaVE6aUCThUx+9rb/Wm3dg9tdfjnHXzEHmobT8eG/ZophuJozVx87aB6Z9y70PJ2CER496bbfXApdUoI+bN3VEUJxw/eKxT+ajPNCv4781s82R/+fKhZc52HnSr4pcLYs5Jr5Cp40YjlLvCDzlNf/VvxbONbGgsamqg1DIKHdHryNkKuVBs55d3yZMuOvVTqSN6/CTY0VZCac2TYTn4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: I am just curious about the purpose of maple node slab objects to be its size aligned, but I can understand why they need to be cache aligned. void __init maple_tree_init(void) { maple_node_cache = kmem_cache_create("maple_node", sizeof(struct maple_node), sizeof(struct maple_node),// Alignment of the slab object. SLAB_PANIC, NULL); } Reason for the ask is, when slub debug enabled with option Z, the change [1] makes the total object to be 256 * 3 (=768)bytes. This turns out to be a problem in debug builds where the unreclaimable slab consumption itself is very high thus exerting the memory pressure on the system. maple_node: orginal object size = 256b after slub_debug enabled = 768b If, there is no special requirement, other than just needs to be cache aligned, thinking of the below: [1]d86bd1bece6f ("mm/slub: support left redzone") Thanks, charan --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6283,8 +6283,8 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) void __init maple_tree_init(void) { maple_node_cache = kmem_cache_create("maple_node", - sizeof(struct maple_node), sizeof(struct maple_node), - SLAB_PANIC, NULL); + sizeof(struct maple_node), 0, + SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); }