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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jWWic 9zH9I0ihzOzkqzadv/lD0YhDZSI6TbkYm6SmgKWq2G5N2hXpLw+8ViLUCR+3XausIbWwYn/wAxBmDzCEFhOIh7TXSVuihAQOOQITy7DvOWwV1iNY7bBKtqORGVcEqCOmojMWfwcOj9+iHEYfdDcZXkg+3KCwJH3ROUCDUj3VSNTfWOWHuVWPcLUiyNNpLIig5OdDI4bA+nBtE5R3Pe03aJjKSHDBBQoGo1Q5mYz+x3lsyGYsUi5RNU8d+URtsKlvZ/aFwiqMuaZc4q4K492Bmcu5TN9dc+hvVWXV452xXocSGDCtdFEFzmgdin5QRNWFZy+eJmlgX/Pp7G+CKLg2Mxb8WxnNCbUN2mPZFppqUfVfTmxJTCpKS9NI71HW1xH24WVW3MpxJuSpvPAhScjIFgV+UmQ3qfRUz+fz6cKHK7WIN/yWbCwSd7hKirqNjypeWsiQ1/aQ+J8I5QnjSwCXHa2pIFTxnIae0xcsm 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 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 ===================================