From patchwork Fri Dec 15 03:41:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 13493985 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 063C6C4332F for ; Fri, 15 Dec 2023 03:42:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F6A48D010A; Thu, 14 Dec 2023 22:42:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A6F48D0103; Thu, 14 Dec 2023 22:42:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76F218D010A; Thu, 14 Dec 2023 22:42:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 682C18D0103 for ; Thu, 14 Dec 2023 22:42:58 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 425961202F0 for ; Fri, 15 Dec 2023 03:42:58 +0000 (UTC) X-FDA: 81567656436.12.5171A95 Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) by imf06.hostedemail.com (Postfix) with ESMTP id 6409318000B for ; Fri, 15 Dec 2023 03:42:56 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=NQeTnqoL; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (imf06.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702611776; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=f6UsQfJqru2wxeQHRYIGzIFx+QojRrWdAumuRT1bErQ=; b=CGj0wC8y/Vyjikfwttu2ibhWw/GInK86mvTykMKbzRnm8ia4w06uUh+Tfvn2s8c/t5hMQ2 qugvKjjaDNeO46+iYJ0+KGtXvd7r9wEC2R3h4Ix69zdeoANTumY2lP1uCsqv/xyfIjN9b5 SqXrAhch0idNd8m0aDXf/9bdfATMhcQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=NQeTnqoL; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (imf06.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702611776; a=rsa-sha256; cv=none; b=dVi8gQ22QJHIZyQGxByAIx5ivHrGV4m0wuVnxC+54IWgSitFF8jHR/fWxW28xTxJata907 yLpbQ8lLcOOVb5JhUPqZQcmOdYiLl/gpL4mq+8Felx84v1rS/90DHa8k3QuGDi1fyzKpJI bhm4Jk7OJRDme5MKh5p7MseafZ7H3bw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1702611775; bh=f6UsQfJqru2wxeQHRYIGzIFx+QojRrWdAumuRT1bErQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=NQeTnqoLw0Gci5WZbfohKqJJQ/vq8zsZvyEd9kC9OLStA5wk21Ct6wwYwuiin5/D2 d+MoCE1/pV/vGJ4n6xj1caykQaZ+NAie4AKhSkZQkQYUInQDyzrlY8JFHlb7e0Ict6 YbaMSC6WJ/baGEMp1gXY+PuOhCcUh+kTKgpyTov8pJ9yle/A0q5RgnDjBuToVHQTTW zV8d0+sxz7AAxqTHSWBlY06XOfuCSKze50gBa3/FP9WHn7l2irQIKexo/cq5tMt0Af FbnAayyW5EBZMgsFjA8T4hF/isd1TWD5lhM/ZTql7nhBKGWRhC0a99PuqzCB9mlUJ/ UzosSUtnVGszw== Received: from xiongwei.. (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id 6862281320; Fri, 15 Dec 2023 03:42:49 +0000 (UTC) From: sxwjean@me.com To: vbabka@suse.cz, 42.hyeyoo@gmail.com, cl@linux.com, linux-mm@kvack.org Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, corbet@lwn.net, keescook@chromium.org, arnd@arndb.de, akpm@linux-foundation.org, gregkh@linuxfoundation.org, quic_jjohnson@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xiongwei Song Subject: [PATCH v4 1/4] Documentation: kernel-parameters: remove noaliencache Date: Fri, 15 Dec 2023 11:41:47 +0800 Message-Id: <20231215034150.108783-2-sxwjean@me.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231215034150.108783-1-sxwjean@me.com> References: <20231215034150.108783-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-GUID: lzIsUutIukHkftBK76aMj4vFZYidGvSF X-Proofpoint-ORIG-GUID: lzIsUutIukHkftBK76aMj4vFZYidGvSF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_17,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=816 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2312150025 X-Rspamd-Queue-Id: 6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Ss5Eig He88M/nr YyjGzGo//lxBJT7PkBaKVLJQB45Td/51f0P291OgWvKIjNGlffiy9s8+CULwpgjcdKUdmmqvqq6JQEBEcrvgfHuJoLbGcD8f+ui90Oq8QMgNL4CD/41BrcVd51KBawRzK0Azm+sFfxovJ0cID2S7zCSTxPtq+VlRI9Gx3IPXEq2CfSIWQFeO5LEq3dW48KmSkCWMj71EekAfgJNEhWXY6//22a+rXOIS9MPRPdWxjiGfUyaF5gNutn23SzF1DPM1VGpbw3NKIFVDKRMXk/hd5X3G+ZsKpHaIvc3asvjjnpeCccnYKbdofV11B5byznD/6IsBA8lZ2ocHxCBrSQgQlhfdOI3+uOAzmWryAQNvgMpUdG58oFhOrI/WOBKXAK4lIqazIz0U3RSPe43IZ42FhjmGEwjFDmOweQIQyhYQsWH0Lnurf8xrtnoHB94dKtcFhpySTunC3fJ0Hxwp80flRArbWCnZuVAQnlolgoWIruBQSDHCXSKLCz+SpXGUroUfKTNA3 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: From: Xiongwei Song Since slab allocator has already been removed. There is no users of the noaliencache parameter, so let's remove it. Suggested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Kees Cook Reviewed-by: Vlastimil Babka Signed-off-by: Xiongwei Song --- v6: Clean up typos. v5: Collect Reviewed-by tag. v4: Collect Reviewed-by tag. v3: Remove the changes for slab_max_order. v2: Add changes for removing "noaliencache". https://lore.kernel.org/linux-mm/20231122143603.85297-1-sxwjean@me.com/ v1: Remove slab_max_order. https://lore.kernel.org/linux-mm/20231120091214.150502-2-sxwjean@me.com/ --- Documentation/admin-guide/kernel-parameters.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 65731b060e3f..9f94baeb2f82 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3740,10 +3740,6 @@ no5lvl [X86-64,RISCV] Disable 5-level paging mode. Forces kernel to use 4-level paging instead. - noaliencache [MM, NUMA, SLAB] Disables the allocation of alien - caches in the slab allocator. Saves per-node memory, - but will impact performance. - noalign [KNL,ARM] noaltinstr [S390] Disables alternative instructions patching From patchwork Fri Dec 15 03:41:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 13493986 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 233ADC4332F for ; Fri, 15 Dec 2023 03:43:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E6198D010B; Thu, 14 Dec 2023 22:43:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 749DE8D0103; Thu, 14 Dec 2023 22:43:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 574AB8D010B; Thu, 14 Dec 2023 22:43:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 38DA58D0103 for ; Thu, 14 Dec 2023 22:43:28 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 04092A0447 for ; Fri, 15 Dec 2023 03:43:27 +0000 (UTC) X-FDA: 81567657696.05.5F5A93F Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) by imf21.hostedemail.com (Postfix) with ESMTP id 22FDD1C0012 for ; Fri, 15 Dec 2023 03:43:25 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=Tm4gEt2e; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (imf21.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702611806; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bODnJlG+KG/EKv36cxETUCIM/X+NGX+FI+DxIHyVCJg=; b=Ea0kn0Blimq7G6T6OaJ86usx60xkYohg7avYoi9282D3LJ1dalz0jCnxofUDXuXTb0iulT j4SMJYYPYWqTT/xDAfgW4XsPF4NOIaTROgiE/bWPvW9wdr0X1usf4luSXDzAxRvUnedyxn gEopTwi6YeRY3WXoP6F8cNmsW5e+W6c= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=Tm4gEt2e; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (imf21.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702611806; a=rsa-sha256; cv=none; b=VtSlCFSBa6UdsumtjyV+sxdkYckS9aToWds5pXa/kES8dgS85QiCpRKKRAR0lGeecblQWk NoA7MLQr7NtJC38ReX/cXXz9TQeHxpiybVeh53qKIGD+Upq2/iYNiJpp552zz3VVfAO5VV Yz4ztu0iChnRUbHGZViWFzsar1rMFN4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1702611804; bh=bODnJlG+KG/EKv36cxETUCIM/X+NGX+FI+DxIHyVCJg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Tm4gEt2epNLFRKmu4dJdJWK4EaWsxTyz7iD8+xIaF3Gbt0jw/GH2WIZfHBqbpqWMF 9kaWSqKVqEEhTPzyAAdoklWOFX5NLIsybV7JM8UfW0y4z0PZ5l6zVPpRTF+q74QnyX px8SumtjYW6GyCTl4MfQioCGfG/yQxmS0ePs34JJISqOGrH3zE4bWnVfEpEot5Ih/w 2v/WWKizvhhvVayAdRyttxlDazD77N3j3SF8Nn9/VXFzdinq7jwzGeC6IizO8GB+q7 4naOrCvtOGV90tEtPQ1oOg2+/vcW2lxPYk5cOLWaYGmMj5wf3iQ0Owda583ogRTSjr zeWkgzXSurFHA== Received: from xiongwei.. (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id B4ACB814DA; Fri, 15 Dec 2023 03:42:58 +0000 (UTC) From: sxwjean@me.com To: vbabka@suse.cz, 42.hyeyoo@gmail.com, cl@linux.com, linux-mm@kvack.org Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, corbet@lwn.net, keescook@chromium.org, arnd@arndb.de, akpm@linux-foundation.org, gregkh@linuxfoundation.org, quic_jjohnson@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xiongwei Song Subject: [PATCH v4 2/4] mm/slub: unify all sl[au]b parameters with "slab_$param" Date: Fri, 15 Dec 2023 11:41:48 +0800 Message-Id: <20231215034150.108783-3-sxwjean@me.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231215034150.108783-1-sxwjean@me.com> References: <20231215034150.108783-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-GUID: VflpYgzwl0eQjRpp7fpmWdTvV29PQhUV X-Proofpoint-ORIG-GUID: VflpYgzwl0eQjRpp7fpmWdTvV29PQhUV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_17,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2312150026 X-Rspamd-Queue-Id: 22FDD1C0012 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: xas4dkqo3g9tstdidfet9sujjwgctzam X-HE-Tag: 1702611805-96336 X-HE-Meta: U2FsdGVkX1/kk5+RNEGaZcF8rwvdIf2OMogQtGtMnnO00RFAPqtHHpuNNtiH7ykxHT35p/rR8SC4HiZmy97w1hFX0EekbJ/Nsc8rnnwG6KpTaAr9x8MHQwVPZOmxGxAtko9tFrhTaldnUzN5u0Nr9q9zrW6/H+Jdkgw24x7tNFIFTrN4O6ny2kQwqIolV/qC01qEzC7of2NDcqUMaOeqrNNHnJWELCfpiBol3H9M3xhgc2LPtS2jJ2usqUuiAKZlc6Zf7gvoUFc0xMCks/X0DRRN95EUvpPobKt8k3cL/7KeIzuikZaA0UsFR+DFfEZwpF4TP6VylyIkv7b4K7Ub2FZ3NCOyBxiKWjsRuscTEHYGjvjNd2+k8RRMLc0GoegAkh6AuNFlLTZ14UGUi1vcnLoe9ltMhOkj9rn7msy35BZkDYLfFNdX0X+kFkNgoAPBkP3RO8/4T06KZqwyeVVvTVo3Umy0D5cG7wLx6q8YxCSn7iOf9J35OS3ZQa0PQhOafipbIx4nNUK8hD3Ii/p9+o15+GilVc3lcJV1QJr5DWlSU22dWuK5eaMDr/nra8HmskkN3wJf7y4M1C5Sughy5T+GaAfv/g35WUt298Tfs3M8CJwrEmIn/QzWripk6VUy23+NJ4gYF6T+tKVPWSGzGCWdnI3Ft9cWfzkYettmdQY55p52CJvZiLXasdkuMPuvsA1H1LnXRyPZdyHHx8lt6HGLqZzZweHKZRlBOsBXC9wfht3S5NiUUFial70GVG4h9H18GQjI/fb+pCpPsv21COPDt6/bcEzE230twI9sS1qNd2kwtOkI5FiknBRJpK9zilbIN3X+/xHLDFdae75TQj/4s6Bjgm/SehoIGCIr9BdevwfzcxYwv+RLJJQciScRiflj5lBGdSBFSe40KKV28XuP9ICJsmHlBIaXwBE6R8VrGDrk09tAGE0l6hiT79Q9KXHw+t6Mx1jcey6BSGe 5/p1f7Qz dqGUP8C3/yMvkP0rtZbKVmrqfy0e2b1F8CUVO9wUnCKgjs6+d4b0/63UTtvK5wsFL2eMVS7RPc/M3KA/ov9P/fAcIbysb4igr5iL0hunJ8VNpfZBe9EDUn+5kJbKDE0uN/84eLXiPstOgXU+ErqeGC2RzT19EK3hOJz+p7etvr/JZ3XZt4HdCiA6OgFeV0baxzfzwSqqENL3Hizf5eqibDiSBy17MmpibQO3TfTwSa4++tcE7Y4U0OwXljSx9yU49gkG3cd8og/Kh4ZLXR1yxY+I3tNqKEWQPc82cCiXF/nm6GQR+Tpq8uHEJGXnS7J8YZQCKU9nSsEQMCp+Tm+HY9cPG0tmAJj7CsCbYYFY0GbIgnhPTDoL7i+m53E5szmW3wsMLRWYaz2iKZ0YXxZ67K4X0ywXy5wGW2dX3c00f9lu+QgVcuPu4PqJdmnIBVoQzuEvHudEr57z9Bs2Ad55OR6ECwfVq2KYqkL4B4QxuJDbd1Yk= 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: From: Xiongwei Song Since the SLAB allocator has been removed, so we can clean up the sl[au]b_$params. With only one slab allocator left, it's better to use the generic "slab" term instead of "slub" which is an implementation detail, which is pointed out by Vlastimil Babka. For more information please see [1]. Hence, we are going to use "slab_$param" as the primary prefix. This patch is changing the following slab parameters - slub_max_order - slub_min_order - slub_min_objects - slub_debug to - slab_max_order - slab_min_order - slab_min_objects - slab_debug as the primary slab parameters for all references of them in docs and comments. But this patch won't change variables and functions inside slub as we will have wider slub/slab change. Meanwhile, "slub_$params" can also be passed by command line, which is to keep backward compatibility. Also mark all "slub_$params" as legacy. Remove the separate descriptions for slub_[no]merge, append legacy tip for them at the end of descriptions of slab_[no]merge. [1] https://lore.kernel.org/linux-mm/7512b350-4317-21a0-fab3-4101bc4d8f7a@suse.cz/ Signed-off-by: Xiongwei Song Reviewed-by: Vlastimil Babka --- .../admin-guide/kernel-parameters.txt | 71 +++++++++---------- drivers/misc/lkdtm/heap.c | 2 +- mm/Kconfig.debug | 6 +- mm/slab.h | 2 +- mm/slab_common.c | 4 +- mm/slub.c | 41 ++++++----- 6 files changed, 62 insertions(+), 64 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9f94baeb2f82..abfc0838feb9 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5864,65 +5864,58 @@ simeth= [IA-64] simscsi= - slram= [HW,MTD] - - slab_merge [MM] - Enable merging of slabs with similar size when the - kernel is built without CONFIG_SLAB_MERGE_DEFAULT. - - slab_nomerge [MM] - Disable merging of slabs with similar size. May be - necessary if there is some reason to distinguish - allocs to different slabs, especially in hardened - environments where the risk of heap overflows and - layout control by attackers can usually be - frustrated by disabling merging. This will reduce - most of the exposure of a heap attack to a single - cache (risks via metadata attacks are mostly - unchanged). Debug options disable merging on their - own. - For more information see Documentation/mm/slub.rst. - - slab_max_order= [MM, SLAB] - Determines the maximum allowed order for slabs. - A high setting may cause OOMs due to memory - fragmentation. Defaults to 1 for systems with - more than 32MB of RAM, 0 otherwise. - - slub_debug[=options[,slabs][;[options[,slabs]]...] [MM, SLUB] - Enabling slub_debug allows one to determine the + slab_debug[=options[,slabs][;[options[,slabs]]...] [MM] + Enabling slab_debug allows one to determine the culprit if slab objects become corrupted. Enabling - slub_debug can create guard zones around objects and + slab_debug can create guard zones around objects and may poison objects when not in use. Also tracks the last alloc / free. For more information see Documentation/mm/slub.rst. + (slub_debug legacy name also accepted for now) - slub_max_order= [MM, SLUB] + slab_max_order= [MM] Determines the maximum allowed order for slabs. A high setting may cause OOMs due to memory fragmentation. For more information see Documentation/mm/slub.rst. + (slub_max_order legacy name also accepted for now) + + slab_merge [MM] + Enable merging of slabs with similar size when the + kernel is built without CONFIG_SLAB_MERGE_DEFAULT. + (slub_merge legacy name also accepted for now) - slub_min_objects= [MM, SLUB] + slab_min_objects= [MM] The minimum number of objects per slab. SLUB will - increase the slab order up to slub_max_order to + increase the slab order up to slab_max_order to generate a sufficiently large slab able to contain the number of objects indicated. The higher the number of objects the smaller the overhead of tracking slabs and the less frequently locks need to be acquired. For more information see Documentation/mm/slub.rst. + (slub_min_objects legacy name also accepted for now) - slub_min_order= [MM, SLUB] + slab_min_order= [MM] Determines the minimum page order for slabs. Must be - lower than slub_max_order. - For more information see Documentation/mm/slub.rst. + lower or equal to slab_max_order. For more information see + Documentation/mm/slub.rst. + (slub_min_order legacy name also accepted for now) - slub_merge [MM, SLUB] - Same with slab_merge. + slab_nomerge [MM] + Disable merging of slabs with similar size. May be + necessary if there is some reason to distinguish + allocs to different slabs, especially in hardened + environments where the risk of heap overflows and + layout control by attackers can usually be + frustrated by disabling merging. This will reduce + most of the exposure of a heap attack to a single + cache (risks via metadata attacks are mostly + unchanged). Debug options disable merging on their + own. + For more information see Documentation/mm/slub.rst. + (slub_nomerge legacy name also accepted for now) - slub_nomerge [MM, SLUB] - Same with slab_nomerge. This is supported for legacy. - See slab_nomerge for more information. + slram= [HW,MTD] smart2= [HW] Format: [,[,...,]] diff --git a/drivers/misc/lkdtm/heap.c b/drivers/misc/lkdtm/heap.c index 0ce4cbf6abda..076ca9b225de 100644 --- a/drivers/misc/lkdtm/heap.c +++ b/drivers/misc/lkdtm/heap.c @@ -47,7 +47,7 @@ static void lkdtm_VMALLOC_LINEAR_OVERFLOW(void) * correctly. * * This should get caught by either memory tagging, KASan, or by using - * CONFIG_SLUB_DEBUG=y and slub_debug=ZF (or CONFIG_SLUB_DEBUG_ON=y). + * CONFIG_SLUB_DEBUG=y and slab_debug=ZF (or CONFIG_SLUB_DEBUG_ON=y). */ static void lkdtm_SLAB_LINEAR_OVERFLOW(void) { diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index 321ab379994f..afc72fde0f03 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -64,11 +64,11 @@ config SLUB_DEBUG_ON help Boot with debugging on by default. SLUB boots by default with the runtime debug capabilities switched off. Enabling this is - equivalent to specifying the "slub_debug" parameter on boot. + equivalent to specifying the "slab_debug" parameter on boot. There is no support for more fine grained debug control like - possible with slub_debug=xxx. SLUB debugging may be switched + possible with slab_debug=xxx. SLUB debugging may be switched off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying - "slub_debug=-". + "slab_debug=-". config PAGE_OWNER bool "Track page owner" diff --git a/mm/slab.h b/mm/slab.h index 54deeb0428c6..f7df6d701c5b 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -528,7 +528,7 @@ static inline bool __slub_debug_enabled(void) #endif /* - * Returns true if any of the specified slub_debug flags is enabled for the + * Returns true if any of the specified slab_debug flags is enabled for the * cache. Use only for flags parsed by setup_slub_debug() as it also enables * the static key. */ diff --git a/mm/slab_common.c b/mm/slab_common.c index 238293b1dbe1..230ef7cc3467 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -282,7 +282,7 @@ kmem_cache_create_usercopy(const char *name, #ifdef CONFIG_SLUB_DEBUG /* - * If no slub_debug was enabled globally, the static key is not yet + * If no slab_debug was enabled globally, the static key is not yet * enabled by setup_slub_debug(). Enable it if the cache is being * created with any of the debugging flags passed explicitly. * It's also possible that this is the first cache created with @@ -766,7 +766,7 @@ EXPORT_SYMBOL(kmalloc_size_roundup); } /* - * kmalloc_info[] is to make slub_debug=,kmalloc-xx option work at boot time. + * kmalloc_info[] is to make slab_debug=,kmalloc-xx option work at boot time. * kmalloc_index() supports up to 2^21=2MB, so the final entry of the table is * kmalloc-2M. */ diff --git a/mm/slub.c b/mm/slub.c index 02d5299810df..842379a17709 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -295,7 +295,7 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s) /* * Debugging flags that require metadata to be stored in the slab. These get - * disabled when slub_debug=O is used and a cache's min order increases with + * disabled when slab_debug=O is used and a cache's min order increases with * metadata. */ #define DEBUG_METADATA_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER) @@ -1605,7 +1605,7 @@ static inline int free_consistency_checks(struct kmem_cache *s, } /* - * Parse a block of slub_debug options. Blocks are delimited by ';' + * Parse a block of slab_debug options. Blocks are delimited by ';' * * @str: start of block * @flags: returns parsed flags, or DEBUG_DEFAULT_FLAGS if none specified @@ -1666,7 +1666,7 @@ parse_slub_debug_flags(char *str, slab_flags_t *flags, char **slabs, bool init) break; default: if (init) - pr_err("slub_debug option '%c' unknown. skipped\n", *str); + pr_err("slab_debug option '%c' unknown. skipped\n", *str); } } check_slabs: @@ -1725,7 +1725,7 @@ static int __init setup_slub_debug(char *str) /* * For backwards compatibility, a single list of flags with list of * slabs means debugging is only changed for those slabs, so the global - * slub_debug should be unchanged (0 or DEBUG_DEFAULT_FLAGS, depending + * slab_debug should be unchanged (0 or DEBUG_DEFAULT_FLAGS, depending * on CONFIG_SLUB_DEBUG_ON). We can extended that to multiple lists as * long as there is no option specifying flags without a slab list. */ @@ -1749,7 +1749,8 @@ static int __init setup_slub_debug(char *str) return 1; } -__setup("slub_debug", setup_slub_debug); +__setup("slab_debug", setup_slub_debug); +__setup_param("slub_debug", slub_debug, setup_slub_debug, 0); /* * kmem_cache_flags - apply debugging options to the cache @@ -1759,7 +1760,7 @@ __setup("slub_debug", setup_slub_debug); * * Debug option(s) are applied to @flags. In addition to the debug * option(s), if a slab name (or multiple) is specified i.e. - * slub_debug=,, ... + * slab_debug=,, ... * then only the select slabs will receive the debug option(s). */ slab_flags_t kmem_cache_flags(unsigned int object_size, @@ -3256,7 +3257,7 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid) oo_order(s->min)); if (oo_order(s->min) > get_order(s->object_size)) - pr_warn(" %s debugging increased min order, use slub_debug=O to disable.\n", + pr_warn(" %s debugging increased min order, use slab_debug=O to disable.\n", s->name); for_each_kmem_cache_node(s, node, n) { @@ -3785,11 +3786,11 @@ void slab_post_alloc_hook(struct kmem_cache *s, struct obj_cgroup *objcg, zero_size = orig_size; /* - * When slub_debug is enabled, avoid memory initialization integrated + * When slab_debug is enabled, avoid memory initialization integrated * into KASAN and instead zero out the memory via the memset below with * the proper size. Otherwise, KASAN might overwrite SLUB redzones and * cause false-positive reports. This does not lead to a performance - * penalty on production builds, as slub_debug is not intended to be + * penalty on production builds, as slab_debug is not intended to be * enabled there. */ if (__slub_debug_enabled()) @@ -4695,8 +4696,8 @@ static unsigned int slub_min_objects; * activity on the partial lists which requires taking the list_lock. This is * less a concern for large slabs though which are rarely used. * - * slub_max_order specifies the order where we begin to stop considering the - * number of objects in a slab as critical. If we reach slub_max_order then + * slab_max_order specifies the order where we begin to stop considering the + * number of objects in a slab as critical. If we reach slab_max_order then * we try to keep the page order as low as possible. So we accept more waste * of space in favor of a small page order. * @@ -4763,14 +4764,14 @@ static inline int calculate_order(unsigned int size) * and backing off gradually. * * We start with accepting at most 1/16 waste and try to find the - * smallest order from min_objects-derived/slub_min_order up to - * slub_max_order that will satisfy the constraint. Note that increasing + * smallest order from min_objects-derived/slab_min_order up to + * slab_max_order that will satisfy the constraint. Note that increasing * the order can only result in same or less fractional waste, not more. * * If that fails, we increase the acceptable fraction of waste and try * again. The last iteration with fraction of 1/2 would effectively * accept any waste and give us the order determined by min_objects, as - * long as at least single object fits within slub_max_order. + * long as at least single object fits within slab_max_order. */ for (unsigned int fraction = 16; fraction > 1; fraction /= 2) { order = calc_slab_order(size, min_order, slub_max_order, @@ -4780,7 +4781,7 @@ static inline int calculate_order(unsigned int size) } /* - * Doh this slab cannot be placed using slub_max_order. + * Doh this slab cannot be placed using slab_max_order. */ order = get_order(size); if (order <= MAX_ORDER) @@ -5306,7 +5307,9 @@ static int __init setup_slub_min_order(char *str) return 1; } -__setup("slub_min_order=", setup_slub_min_order); +__setup("slab_min_order=", setup_slub_min_order); +__setup_param("slub_min_order=", slub_min_order, setup_slub_min_order, 0); + static int __init setup_slub_max_order(char *str) { @@ -5319,7 +5322,8 @@ static int __init setup_slub_max_order(char *str) return 1; } -__setup("slub_max_order=", setup_slub_max_order); +__setup("slab_max_order=", setup_slub_max_order); +__setup_param("slub_max_order=", slub_max_order, setup_slub_max_order, 0); static int __init setup_slub_min_objects(char *str) { @@ -5328,7 +5332,8 @@ static int __init setup_slub_min_objects(char *str) return 1; } -__setup("slub_min_objects=", setup_slub_min_objects); +__setup("slab_min_objects=", setup_slub_min_objects); +__setup_param("slub_min_objects=", slub_min_objects, setup_slub_min_objects, 0); #ifdef CONFIG_HARDENED_USERCOPY /* From patchwork Fri Dec 15 03:41:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 13493987 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 27AB8C4332F for ; Fri, 15 Dec 2023 03:43:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B41C88D010C; Thu, 14 Dec 2023 22:43:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF21D8D0103; Thu, 14 Dec 2023 22:43:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B9A98D010C; Thu, 14 Dec 2023 22:43:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8C3778D0103 for ; Thu, 14 Dec 2023 22:43:37 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 653551604AF for ; Fri, 15 Dec 2023 03:43:37 +0000 (UTC) X-FDA: 81567658074.17.A0E8DE6 Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) by imf02.hostedemail.com (Postfix) with ESMTP id 7B0208000E for ; Fri, 15 Dec 2023 03:43:35 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=1b8ySxpm; spf=pass (imf02.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702611815; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pu4d5aNzA1zqsUzUFwgPinQJl+CtlywCevtlg+7cEw8=; b=X0mom8GwA2hpN9uwe4hn1PscA/njz5mSJmHmXkGErpEtARGhqBWFHKTiddfjhbZdxEPMRx w1Ve1eg1w4tendJRZjfZeHeJ+8MKRab0pqst9SQWpSyf0g6+MSYaRZqZ3cGXSpsIolA+9S 4yzKr5kddslzwNF3uZ6VFI76HXmERqA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=1b8ySxpm; spf=pass (imf02.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702611815; a=rsa-sha256; cv=none; b=CfULsn32WWMzw5CKesR++KOVtacoF2LoDQOFMygsTyEpDQsZ118aAQ1cv8rIiVIKYqfnnO AMu30k5Kz9QOW6JhsPko+0tuyAVgcsbR928C9UEk0hvseECJEFAvJXl5l+4m6D4zRaBQ9K aXkmXNDPuo64tpe0fotFgIZUWBbQQso= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1702611814; bh=pu4d5aNzA1zqsUzUFwgPinQJl+CtlywCevtlg+7cEw8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=1b8ySxpmUmF/WfrjnX7hWNTOFJXzRUlqS+zypQV+Z3pT5zSf3XGZP6XcgWAOvssI7 RWMTcncJrbal6ww0qvfHjbCGfUV7GUddbxj303J307YALcGK0dQKtHBSak3ri8wCjm 8Ura9mNB7SpAFkwXFVZSokF8Ao2sXriVurQLUfC8BvP1SDepw6yEMBmKs/PQUOC2Dn PsJk8SqTzsIoB/KiaXEH1UNWB06meJTCKihdhVw8HgFpbwRR2grSMFLT2B0ET5uK/U 1GdDfZKGn+/Ze3d5sh7iky0zU4/le4cpIolAIFl3rjiHM29diH6a7X2Wi4vzl9CJ/O +Ei9iTA7stBgA== Received: from xiongwei.. (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id B57338151D; Fri, 15 Dec 2023 03:43:27 +0000 (UTC) From: sxwjean@me.com To: vbabka@suse.cz, 42.hyeyoo@gmail.com, cl@linux.com, linux-mm@kvack.org Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, corbet@lwn.net, keescook@chromium.org, arnd@arndb.de, akpm@linux-foundation.org, gregkh@linuxfoundation.org, quic_jjohnson@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xiongwei Song Subject: [PATCH v4 3/4] mm/slub: replace slub_$params with slab_$params in slub.rst Date: Fri, 15 Dec 2023 11:41:49 +0800 Message-Id: <20231215034150.108783-4-sxwjean@me.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231215034150.108783-1-sxwjean@me.com> References: <20231215034150.108783-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-GUID: irjatwxLXpPhIhTP0epExD4SmTt0yzW1 X-Proofpoint-ORIG-GUID: irjatwxLXpPhIhTP0epExD4SmTt0yzW1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_17,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2312150026 X-Rspamd-Queue-Id: 7B0208000E X-Rspam-User: X-Stat-Signature: d7ba5asqs9ubkh6ro9z9rd8jdso9xgm7 X-Rspamd-Server: rspam01 X-HE-Tag: 1702611815-618785 X-HE-Meta: U2FsdGVkX1+VBt92/tfzLiMB8Dfzz57aHK+i9lHDlvOpa9F+rJXzc9mgakur7VRmwmXvYAl6wlEdG6oeD4FTuYK2zYGsqyJ+p4tkA64SrS+4VuBQn0LvDU2BK+CUc09wt9IgwIKNR/0Rat4dODKNaLf3pO3ASbHtk1ut+hHvy3s2poDlVyewOEN38GkjWMZo4wvC0epkmszBYivKmf9ZMvJYbm2rbRzf0uAlOqbA/El7y0R3/Q/OrZos4PvIe/fzv4V4upSeR09DHTaimmj2S8YVN14g51ioFVSIj6UYrXPOek38zbQzFYnG+agrlHcOnMhi94n7EVzBsWLmuY/WEpXA4Z/EPhtvPgBfz181BtgEe2UOh+ehzGwYm8jB8C+apmvVk0QaIvv0U3PrkQsd/uXDlvKJF48KyFnByBtMV8NbVg1Xrs44MOc/d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: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Xiongwei Song We've unified slab parameters with "slab_$params", then we can use slab_$params in Documentation/mm/slub.rst. Signed-off-by: Xiongwei Song Reviewed-by: Vlastimil Babka --- Documentation/mm/slub.rst | 60 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Documentation/mm/slub.rst b/Documentation/mm/slub.rst index be75971532f5..6579a55b7852 100644 --- a/Documentation/mm/slub.rst +++ b/Documentation/mm/slub.rst @@ -9,7 +9,7 @@ SLUB can enable debugging only for selected slabs in order to avoid an impact on overall system performance which may make a bug more difficult to find. -In order to switch debugging on one can add an option ``slub_debug`` +In order to switch debugging on one can add an option ``slab_debug`` to the kernel command line. That will enable full debugging for all slabs. @@ -26,16 +26,16 @@ be enabled on the command line. F.e. no tracking information will be available without debugging on and validation can only partially be performed if debugging was not switched on. -Some more sophisticated uses of slub_debug: +Some more sophisticated uses of slab_debug: ------------------------------------------- -Parameters may be given to ``slub_debug``. If none is specified then full +Parameters may be given to ``slab_debug``. If none is specified then full debugging is enabled. Format: -slub_debug= +slab_debug= Enable options for all slabs -slub_debug=,,,... +slab_debug=,,,... Enable options only for select slabs (no spaces after a comma) @@ -60,23 +60,23 @@ Possible debug options are:: F.e. in order to boot just with sanity checks and red zoning one would specify:: - slub_debug=FZ + slab_debug=FZ Trying to find an issue in the dentry cache? Try:: - slub_debug=,dentry + slab_debug=,dentry to only enable debugging on the dentry cache. You may use an asterisk at the end of the slab name, in order to cover all slabs with the same prefix. For example, here's how you can poison the dentry cache as well as all kmalloc slabs:: - slub_debug=P,kmalloc-*,dentry + slab_debug=P,kmalloc-*,dentry Red zoning and tracking may realign the slab. We can just apply sanity checks to the dentry cache with:: - slub_debug=F,dentry + slab_debug=F,dentry Debugging options may require the minimum possible slab order to increase as a result of storing the metadata (for example, caches with PAGE_SIZE object @@ -84,20 +84,20 @@ sizes). This has a higher liklihood of resulting in slab allocation errors in low memory situations or if there's high fragmentation of memory. To switch off debugging for such caches by default, use:: - slub_debug=O + slab_debug=O You can apply different options to different list of slab names, using blocks of options. This will enable red zoning for dentry and user tracking for kmalloc. All other slabs will not get any debugging enabled:: - slub_debug=Z,dentry;U,kmalloc-* + slab_debug=Z,dentry;U,kmalloc-* You can also enable options (e.g. sanity checks and poisoning) for all caches except some that are deemed too performance critical and don't need to be debugged by specifying global debug options followed by a list of slab names with "-" as options:: - slub_debug=FZ;-,zs_handle,zspage + slab_debug=FZ;-,zs_handle,zspage The state of each debug option for a slab can be found in the respective files under:: @@ -105,7 +105,7 @@ under:: /sys/kernel/slab// If the file contains 1, the option is enabled, 0 means disabled. The debug -options from the ``slub_debug`` parameter translate to the following files:: +options from the ``slab_debug`` parameter translate to the following files:: F sanity_checks Z red_zone @@ -129,7 +129,7 @@ in order to reduce overhead and increase cache hotness of objects. Slab validation =============== -SLUB can validate all object if the kernel was booted with slub_debug. In +SLUB can validate all object if the kernel was booted with slab_debug. In order to do so you must have the ``slabinfo`` tool. Then you can do :: @@ -150,29 +150,29 @@ list_lock once in a while to deal with partial slabs. That overhead is governed by the order of the allocation for each slab. The allocations can be influenced by kernel parameters: -.. slub_min_objects=x (default 4) -.. slub_min_order=x (default 0) -.. slub_max_order=x (default 3 (PAGE_ALLOC_COSTLY_ORDER)) +.. slab_min_objects=x (default 4) +.. slab_min_order=x (default 0) +.. slab_max_order=x (default 3 (PAGE_ALLOC_COSTLY_ORDER)) -``slub_min_objects`` +``slab_min_objects`` allows to specify how many objects must at least fit into one slab in order for the allocation order to be acceptable. In general slub will be able to perform this number of allocations on a slab without consulting centralized resources (list_lock) where contention may occur. -``slub_min_order`` +``slab_min_order`` specifies a minimum order of slabs. A similar effect like - ``slub_min_objects``. + ``slab_min_objects``. -``slub_max_order`` - specified the order at which ``slub_min_objects`` should no +``slab_max_order`` + specified the order at which ``slab_min_objects`` should no longer be checked. This is useful to avoid SLUB trying to - generate super large order pages to fit ``slub_min_objects`` + generate super large order pages to fit ``slab_min_objects`` of a slab cache with large object sizes into one high order page. Setting command line parameter ``debug_guardpage_minorder=N`` (N > 0), forces setting - ``slub_max_order`` to 0, what cause minimum possible order of + ``slab_max_order`` to 0, what cause minimum possible order of slabs allocation. SLUB Debug output @@ -219,7 +219,7 @@ Here is a sample of slub debug output:: FIX kmalloc-8: Restoring Redzone 0xc90f6d28-0xc90f6d2b=0xcc If SLUB encounters a corrupted object (full detection requires the kernel -to be booted with slub_debug) then the following output will be dumped +to be booted with slab_debug) then the following output will be dumped into the syslog: 1. Description of the problem encountered @@ -239,7 +239,7 @@ into the syslog: pid= (Object allocation / free information is only available if SLAB_STORE_USER is - set for the slab. slub_debug sets that option) + set for the slab. slab_debug sets that option) 2. The object contents if an object was involved. @@ -262,7 +262,7 @@ into the syslog: the object boundary. (Redzone information is only available if SLAB_RED_ZONE is set. - slub_debug sets that option) + slab_debug sets that option) Padding
: Unused data to fill up the space in order to get the next object @@ -296,7 +296,7 @@ Emergency operations Minimal debugging (sanity checks alone) can be enabled by booting with:: - slub_debug=F + slab_debug=F This will be generally be enough to enable the resiliency features of slub which will keep the system running even if a bad kernel component will @@ -311,13 +311,13 @@ and enabling debugging only for that cache I.e.:: - slub_debug=F,dentry + slab_debug=F,dentry If the corruption occurs by writing after the end of the object then it may be advisable to enable a Redzone to avoid corrupting the beginning of other objects:: - slub_debug=FZ,dentry + slab_debug=FZ,dentry Extended slabinfo mode and plotting =================================== From patchwork Fri Dec 15 03:41:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 13493988 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 985B6C4332F for ; Fri, 15 Dec 2023 03:43:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 242368D010D; Thu, 14 Dec 2023 22:43:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F0A68D0103; Thu, 14 Dec 2023 22:43:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0921D8D010D; Thu, 14 Dec 2023 22:43:46 -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 EA3AF8D0103 for ; Thu, 14 Dec 2023 22:43:45 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C49B2A0447 for ; Fri, 15 Dec 2023 03:43:45 +0000 (UTC) X-FDA: 81567658410.26.4DA8BFC Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) by imf25.hostedemail.com (Postfix) with ESMTP id F2850A001C for ; Fri, 15 Dec 2023 03:43:43 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=YDJX5xy+; spf=pass (imf25.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702611824; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=445I71dWNky8gFBXioboudiXUB/462lbJ09ljq2mQN4=; b=cAffgih9RUiqn8dsqlwp1ph57he3h9Nmu/nF4SCSD/rMHBMgTJWJpAwy4Bj/mJgheNTCN5 PIdL8CmdjkhH6AD1b9h43lF6QgECZLwfXaNDL/ZxLAKjRHM+3Tbb6zd+dQTLVxP5H8RfQ1 bGSE+6eAjpM8pBxmm06NoRfQxJglaig= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702611824; a=rsa-sha256; cv=none; b=4Zd4EMn/ouVIjR+AUyV4F1C2dsxfHUgyzmPk6Gt8KIhgajU5gXUwhzsPyHLHi2nll+0Ssl fZvkN97KUCcUYubsmNFqICCpBTDjnCDhEqBPV2N2V4zOXg/eaEnV7crNvOHH8fKBwtMf0y wirkYRAtjStjSxAk2f5TYSTrJVw9pTg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=YDJX5xy+; spf=pass (imf25.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.55 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1702611823; bh=445I71dWNky8gFBXioboudiXUB/462lbJ09ljq2mQN4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=YDJX5xy+W1UfNbpOBoXmIjJYhQF1Ceu3p8Dkx7b9/KzzjIQUnBpu9dcohJw+H5mLA FnT8DjHyxNjgo1h76F+ZAgUsw1lMc+8H+CELa7EeTILVzWBYqFE4JkQTNE8k9f6hK/ hYadR5auSh+QcZhwd5Vajf5vmRiULiPDDNczRtIzOUqRol7UORD6QXatwEW7HLpSbz jxeACvPM5LbqnVjf13xFt58jSBRt6Y3E8XdygB/Ar4WWPY3YX5My9BX4TgdEuvtW7Z 9OcX+Ga010xmPgTwVWrjUqEtqDrA2uz8piKj8zU+pKc1+Zz+7mrUfAbSrdbbPBxQP+ AYL/6h3Em0LVw== Received: from xiongwei.. (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id A07BF813C8; Fri, 15 Dec 2023 03:43:36 +0000 (UTC) From: sxwjean@me.com To: vbabka@suse.cz, 42.hyeyoo@gmail.com, cl@linux.com, linux-mm@kvack.org Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, corbet@lwn.net, keescook@chromium.org, arnd@arndb.de, akpm@linux-foundation.org, gregkh@linuxfoundation.org, quic_jjohnson@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xiongwei Song Subject: [PATCH v4 4/4] mm/slub: make the description of slab_min_objects helpful in doc Date: Fri, 15 Dec 2023 11:41:50 +0800 Message-Id: <20231215034150.108783-5-sxwjean@me.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231215034150.108783-1-sxwjean@me.com> References: <20231215034150.108783-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-GUID: 8lD-3Etja8ZIaO9ffj4EqA9SJ3T_cRqs X-Proofpoint-ORIG-GUID: 8lD-3Etja8ZIaO9ffj4EqA9SJ3T_cRqs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_17,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2312150026 X-Rspamd-Queue-Id: F2850A001C X-Rspam-User: X-Stat-Signature: qbqosbtdjxz56x64a17sfni4j4zyjzh5 X-Rspamd-Server: rspam03 X-HE-Tag: 1702611823-928054 X-HE-Meta: U2FsdGVkX1+ablpXDN8u8nb3An9uL5dpQA4h3sxtqOaiwhiGKRaQbIzg9wfkKtPlGT2HvYkkN6EJO6ENJX/JNIZx+doU5Lj0Z/X2ssmOpncw+taI5LHp4f+BKfudKcShU6Eq+KY8z/VVuZaBPlFcsxllXib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ad18jrAfA+mpGyo8ZXmvyvb5F+1HJo27LATacRqR0wvcBZ3Vp2P/ePtYu3G31QfdWzpTigl7to2qU6JEqaNo1ledVYZFQ4lfZ0otpFTM3DyXjARlKOZFbsTtebdG+s2maHheHChensEru7Kl+IVPlUZ50FZxHs9gbT0GM= 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: From: Xiongwei Song There is no a value assigned to slab_min_objects by default, it always is 0 that is initialized by compiler if no assigned value by command line. min_objects is calculated based on processor numbers in calculate_order(). For more details, see commit 9b2cd506e5f2 ("slub: Calculate min_objects based on number of processors.") Signed-off-by: Xiongwei Song Reviewed-by: Vlastimil Babka --- Documentation/mm/slub.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/mm/slub.rst b/Documentation/mm/slub.rst index 6579a55b7852..213491ffb66f 100644 --- a/Documentation/mm/slub.rst +++ b/Documentation/mm/slub.rst @@ -150,7 +150,7 @@ list_lock once in a while to deal with partial slabs. That overhead is governed by the order of the allocation for each slab. The allocations can be influenced by kernel parameters: -.. slab_min_objects=x (default 4) +.. slab_min_objects=x (default:automatically scaled by number of cpus) .. slab_min_order=x (default 0) .. slab_max_order=x (default 3 (PAGE_ALLOC_COSTLY_ORDER))