From patchwork Wed Sep 25 03:22:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13811574 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 DB59DCF9C69 for ; Wed, 25 Sep 2024 03:24:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F6C36B0089; Tue, 24 Sep 2024 23:24:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 089FE6B008C; Tue, 24 Sep 2024 23:24:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E89D46B0092; Tue, 24 Sep 2024 23:24:05 -0400 (EDT) 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 C711B6B0089 for ; Tue, 24 Sep 2024 23:24:05 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 32326A083E for ; Wed, 25 Sep 2024 03:24:05 +0000 (UTC) X-FDA: 82601816850.28.E8E4635 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf02.hostedemail.com (Postfix) with ESMTP id 3589480011 for ; Wed, 25 Sep 2024 03:24:01 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727234523; 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: in-reply-to:in-reply-to:references:references; bh=8/EGnKaQxQP2OdeDNYnhB9q75oem9iMrLP8BBOAenmo=; b=LPz842x45dm2mxnRv39Y3VvFdCyVSrUT979uHgtxUSdqDVVNn4PJqz1iVzvPAYRuK0TKhJ AfLczVrNvB2X+bfeWEnRWdHnnegav+nkdYsH4ds4PHi+r1lo/0a8h+3nPiMu9dUf141uEz IQ52uVZPEPhn6Sa4CiiW7yLxtIgXTJ0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727234523; a=rsa-sha256; cv=none; b=bIcqvdgjW9Lvq3ntPmr4LOT+ucf7kul11+hmj6Q+CZZSTHj9niU9geca2Du3UxsA6m1SJA Afi+D2ibXCKQ9c3SaRo/yI50mcUgDzveXkZX5AhGLe7tQe+/4snuds0UTMfPWiQsgr81gT H9oT4vGsxbLA8ctRrz4m31NBHzpaV+4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com; dmarc=none Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 48P3N88G053972; Wed, 25 Sep 2024 11:23:08 +0800 (+08) (envelope-from fangzheng.zhang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XD20r40LZz2Mx63v; Wed, 25 Sep 2024 11:15:24 +0800 (CST) Received: from bj10906pcu1.spreadtrum.com (10.0.73.72) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 25 Sep 2024 11:23:05 +0800 From: Fangzheng Zhang To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Greg KH CC: , , , Fangzheng Zhang , Fangzheng Zhang , Yuming Han Subject: [PATCH 1/2] mm/slub: Add panic function when slub leaks Date: Wed, 25 Sep 2024 11:22:55 +0800 Message-ID: <20240925032256.1782-2-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240925032256.1782-1-fangzheng.zhang@unisoc.com> References: <20240925032256.1782-1-fangzheng.zhang@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.0.73.72] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 48P3N88G053972 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3589480011 X-Stat-Signature: 6b9atkwd3u36jhti7whsy6g934swonfe X-HE-Tag: 1727234641-312567 X-HE-Meta: U2FsdGVkX18ynZC22mTjyLnQZHGa91MLHGIey3mLrXLElIkcUEXu7SmrNyC1cnees+m7aKD/cUQ75pKZY5QxBakJMzOSA+hzatpfbRezz5fIdlZ5zvSKJkzj28/pS0xHChD7n9rzLaJadpMw4bsFYbY0nFZJspkMEhtudYE7cFa5M7nFsCNgGMMJEM/FrvbB+CWQayLg1E5It/vDOD5Fm4HZ2F7Obf67B2F5tt6UR1wBJFciTCllxRBUCUrMDljWfnMWGhPLxbK63PT/YFaZZEkwt6wbuV88YqyOVeDSn0/dAYpIkgw7GGqKOc8iFK/LDSyEk1zde/4yWNhhBnc1TI9Kj1tpemvZcsmgGQYUCog/FpocfD3pcnBGMv+GEWYo475S5pB2hRCvfXCboFEn43vEeTtVgu88ikbBiEduIrnzbxFivdAZ540/HdEZaTTZj6Zd3dIO0OKw2Hrckrk9irMckfAKtiKWuovYlV8jNtfavkTuN3OvOvbdRzA4IPxu6oWwJ3820LIDlJ/9w+IFIiKlV8ct5qlYVZKQ2sKaHYZgwfZKEpvLaJUZOr3/4K18sVptcuwpgtr7655mLWa5Yr1sAycIL5bLe4pmT7kcRKS775VHr2Yd+Ej1WDYdW+Sup/FS8n5FTOIIJIm/4PGXdik0LG7GSIUSCjAsY7VRDSr7cTCNaBRNPGQHItwV5m3jdI+88x2ANGPrZqKc2YT9vkMvCnmam++ytUX2mzBD8tLuHJkIvOcZ/0r4MVzjTXqAYp7UpulTF/6QRTh+jEf7D3/0vq5Y1UjP9oL2o2w1jADGLRPFy6woDDkEzIL4JCfvUbyHc8QHWlr/tPcLbKg8MjQq/QqAZMA/YFpB77k1oWK/z9/INauNOjb21XcZtw04rKVg/1/N9l27gbOky35HURPnDEO8PhkZjVJaHziD9otBfNP1S6s75NYqQtwsHEBOwcfFy/CyhiTfbJ8zSrk Qk+GjgPi Mls+0UNDW2McUNaZRBQnKLa7qWkcJwDY3gH1G4OXVezi298bMGvfK2TlMiYJcp9E3dyrzmVbeSQdQ5mmNeZU4y3BVEdKBTKzs4cTuzr3R8D0v2tOAykHue7R6+O77y2Zv+hWBKlTof3pDlt9DnbFeJIYT3aW/Vmh3c07Fsi01ov8mXWxkzBRlFGKIzdA1uxCEkx816+hnSTQzCewULh7VNpljLwRb7ja7qmFvvDfLpF5Gk+I= 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: Perform real-time memory usage monitoring on the slub page allocation paths, ie, kmalloc_large_alloced and alloc_slab_page. When the usage exceeds the set threshole value, the panic function will be triggered. Signed-off-by: Fangzheng Zhang --- mm/Kconfig | 11 ++++++++ mm/slub.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) +#endif /* CONFIG_SLUB_LEAK_PANIC */ diff --git a/mm/Kconfig b/mm/Kconfig index 09aebca1cae3..60cf72d4f0da 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -255,6 +255,17 @@ config SLUB_TINY If unsure, say N. +config SLUB_LEAK_PANIC + bool "Trigger panic when slub leaks" + default y + help + Detect slub leaks by monitoring its usage in real time on the page + allocation path of the slub. When the slub occupancy exceeds the + user-set value, it is considered that the slub is leaking at this + time, and a panic operation will be triggered immediately. Uers + can enable and set leak threshold by using the kernel command line + parameters "slub.leak_panic" and "slub.leak_panic_threshold". + config SLAB_MERGE_DEFAULT bool "Allow slab caches to be merged" default y diff --git a/mm/slub.c b/mm/slub.c index 21f71cb6cc06..91049f87ab98 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -42,6 +42,9 @@ #include #include #include +#ifdef CONFIG_SLUB_LEAK_PANIC +#include +#endif #include #include @@ -218,6 +221,15 @@ DEFINE_STATIC_KEY_FALSE(slub_debug_enabled); #endif #endif /* CONFIG_SLUB_DEBUG */ +/* Internal slub_leak_panic definitions */ +#ifdef CONFIG_SLUB_LEAK_PANIC +#define K(x) ((x) << (PAGE_SHIFT-10)) +static bool __read_mostly slub_leak_panic_enabled; +static unsigned int __read_mostly slub_leak_panic_threshold; +static long max_slab_count, temp_slab_count; +#endif + + /* Structure holding parameters for get_partial() call chain */ struct partial_context { gfp_t flags; @@ -2424,6 +2436,21 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node, if (folio_is_pfmemalloc(folio)) slab_set_pfmemalloc(slab); +#ifdef CONFIG_SLUB_LEAK_PANIC + if (likely(slub_leak_panic_enabled) && slub_leak_panic_threshold > 0) { + max_slab_count = K(totalram_pages()) * slub_leak_panic_threshold / 100; + temp_slab_count = K(global_node_page_state_pages(NR_SLAB_RECLAIMABLE_B)) + + K(global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B)) + + K(1 << order); + if (temp_slab_count > max_slab_count) + panic("SLAB LEAK: %s(temp_count %6luKB > max_count %6luKB):\n" + "%s gfp_mask=%#x(%pGg), order=%d kB, oom_score_adj=%d\n", + __func__, temp_slab_count, max_slab_count, + current->comm, flags, &flags, order, + current->signal->oom_score_adj); + } +#endif + return slab; } @@ -4212,6 +4239,19 @@ static void *___kmalloc_large_node(size_t size, gfp_t flags, int node) ptr = folio_address(folio); lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B, PAGE_SIZE << order); +#ifdef CONFIG_SLUB_LEAK_PANIC + if (likely(slub_leak_panic_enabled) && slub_leak_panic_threshold > 0) { + max_slab_count = K(totalram_pages()) * slub_leak_panic_threshold / 100; + temp_slab_count = K(global_node_page_state_pages(NR_SLAB_RECLAIMABLE_B)) + + K(global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B)); + if (temp_slab_count > max_slab_count) + panic("SLAB LEAK: %s(temp_count %6luKB > max_count %6luKB):\n" + "%s gfp_mask=%#x(%pGg), order=%d kB, oom_score_adj=%d\n", + __func__, temp_slab_count, max_slab_count, + current->comm, flags, &flags, order, + current->signal->oom_score_adj); + } +#endif } ptr = kasan_kmalloc_large(ptr, size, flags); @@ -7443,3 +7483,39 @@ void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo) sinfo->cache_order = oo_order(s->oo); } #endif /* CONFIG_SLUB_DEBUG */ + +/* + * The /sys/module/slub ABI + */ +#ifdef CONFIG_SLUB_LEAK_PANIC +/* + * What: /sys/module/slub/parameters/leak_panic + * /sys/module/slub/parameters/leak_panic_threshold + * Date: Sep 2024 + * KernelVersion: v6.6+ + * Description: Used for slub memory leak check. When the user + * successfully allocates the slub page, it also performs + * statistics on the total slub usage in the system. + * When the usage exceeds the set value + * (threshold * memtotal / 100), it is considered that + * there is a risk of slub leakage in the system at this time. + * A panic operation will be triggered. + * Users: userspace + */ +MODULE_PARM_DESC(leak_panic, "Disable/Enable slub_leak_panic"); +module_param_named(leak_panic, slub_leak_panic_enabled, bool, 0644); + +static int slub_leak_panic_threshold_set(const char *val, const struct kernel_param *kp) +{ + return param_set_uint_minmax(val, kp, 0, 100); +} + +static const struct kernel_param_ops slub_leak_panic_threshold_ops = { + .set = slub_leak_panic_threshold_set, + .get = param_get_uint, +}; + +MODULE_PARM_DESC(leak_panic_threshold, + "Upper limit value of slub, expressed as a percentage of memtotal (0 ~ 100)"); +module_param_cb(leak_panic_threshold, + &slub_leak_panic_threshold_ops, &slub_leak_panic_threshold, 0644); From patchwork Wed Sep 25 03:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13811575 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 9FD35CF9C69 for ; Wed, 25 Sep 2024 03:24:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 341066B008C; Tue, 24 Sep 2024 23:24:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CA656B0092; Tue, 24 Sep 2024 23:24:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16B0C6B0095; Tue, 24 Sep 2024 23:24:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F05AE6B008C for ; Tue, 24 Sep 2024 23:24:09 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6CFDEC0809 for ; Wed, 25 Sep 2024 03:24:09 +0000 (UTC) X-FDA: 82601817018.15.1529B75 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by imf20.hostedemail.com (Postfix) with ESMTP id 17AE71C0006 for ; Wed, 25 Sep 2024 03:24:06 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf20.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727234612; a=rsa-sha256; cv=none; b=GaxqN+FaJihnULlJi6fdqqhAwT8eBsvaBZCGMFm8EOpIyCgESqKSCGx1Bmyn20+HpXgcAE lo5sdS3SonFmgeDECB8dLpLgf67GXbqsQG30ClJNUvS+cLJFU25qspos/rfoC0AHGWm5kf yU2czEkvbjLK4OVWWwVzFKlDj2Z0su0= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf20.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727234612; 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: in-reply-to:in-reply-to:references:references; bh=GLKjqRufNnI18gK1jNGyjfpJOemJJqES36jgZ40Zx2A=; b=zIquRkWV5ndE0m+OmXY2SY3OYriEdWwQLHOLRAgMgiMP0EvhZoZOJc7VqfW/t1ZVfKP4Qb OHKbLuafn/+ZphKcuqkq3VGWEDHnjG5p6wq1H95tp+pt6vpLsV0hXHEg+H41+/AI9yxwct LKTPwVAKpU8rE+VYbeeTjRFnd20byiw= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 48P3NE3x054301; Wed, 25 Sep 2024 11:23:14 +0800 (+08) (envelope-from fangzheng.zhang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XD20y3PGQz2Mx63v; Wed, 25 Sep 2024 11:15:30 +0800 (CST) Received: from bj10906pcu1.spreadtrum.com (10.0.73.72) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 25 Sep 2024 11:23:11 +0800 From: Fangzheng Zhang To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Greg KH CC: , , , Fangzheng Zhang , Fangzheng Zhang , Yuming Han Subject: [PATCH 2/2] Documentation: admin-guide: kernel-parameters: Add parameter description for slub_leak_panic function Date: Wed, 25 Sep 2024 11:22:56 +0800 Message-ID: <20240925032256.1782-3-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240925032256.1782-1-fangzheng.zhang@unisoc.com> References: <20240925032256.1782-1-fangzheng.zhang@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.0.73.72] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 48P3NE3x054301 X-Rspam-User: X-Rspamd-Queue-Id: 17AE71C0006 X-Rspamd-Server: rspam01 X-Stat-Signature: 69gr5mi14xmhzfwcsghzbx81x46rirz8 X-HE-Tag: 1727234646-211173 X-HE-Meta: U2FsdGVkX19ui5oMhV9cyXRpg9oGWNi2GUaf4Fvwr0zOfA/QhdUyn6s6ScXWLWwfYbht8+dKBC22BjEGaOF+oT9QvR1OSxalpTIfRppd9eswAHa5mSpjj/MU8NPlexT8QjPqMyRsAE+QJjOYFSGAQVrXJPH8aXHZ6sGIqMi/9GFd99nA0rBG1QicZExNqPMrwxO0VEOLpqBvxa2SlwpP0YvtZylC/t0DvRJaPyjUfVDZps16QD9dwhy+dlPVcahGCaJW639Scg2LAnkqI+WF6TDXXLTPaH+mxxZ8ixK8oFvqWq0nlSCpEoxVI3x67zdyTHYRoe8i6iP7dnW2cW3imxnVKWsYvsAV7eKr+h5JiVwZ9DivUms8xRWhNPCj6hOQBdeDiXkwlGmlDTDmi61Z6zsDbaMM+QSwW5IuqvX/YU8lvg1tw2JxaBNqHhKOU3KdPM+OXioTmdmIpyZW5OU/9H9y8Ee6/w9pehNtB6n7oprhhuU4LzgIhnLl7A21uXXOgbqigsZowiR40mTB3dTIP0KZNgKHK7TsLxlLEwDSNrUn90ugEt+RAV4b1Dj7fVsHcL1aJ3N9+CmuuNzX+QKKovj8YnTkA3fHt4nTq8XkphmRR7+9Ed7dO0bnxUI9vFvB+kEwzLzXQiicxeawMFwGZunRI3Xe+BkVemnJr9Vxfyvxi/yW+qjnLJEpiS3Gam/MKJmXgSarfJ8N8wT5FSyECtUC9gTnqkLc0VEzp8B1pOQQHCWDdhv/UtxpvACv7nxiY/EfH7WHVXI7LPa/4L1iisDQkQe4UPsRjf+QI0ssigdsaDWMsSM1gwXEUh4NMMpTOlCs+E11ZvX1Zff72FfLkBFGG5k6Q6qAzVPy9LkbUEfsbHzaO2ojyQpe15jV98tXWL3KoR35e5al3FFW7Nc2tJRRQCY3DLdt4XTdMta+uhtmQEg40ZQPKmKVd0bIsvkCWDyc4/H3De5ZTJghJ+d eIDRQD13 aE6i+vCu4n+OOYFfxDThsan6sD5Y+MYyYHCQnB13oao1Q1kUTP0+/vpdYypDKnc9tSQhaAAPIL2WNJwulCuMlI+uoS0akDgdnMbmDSb3huzOgBAHs4AakrPnx0+9eD3uKy1yrYKfEMb1AyqY3onK2UJ2qqtox2H+IDepbEsUfnq0mNcbvAysH52Wa2CECxmOLYiPWKHMacCwKShlYTlIsHnurTbdJh2HXveyf 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: Introduce the details of the slub_leak_panic parameters in kernel-parameters.txt, so that users can understand how to use the parameters more quickly. Signed-off-by: Fangzheng Zhang --- Documentation/admin-guide/kernel-parameters.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index bb48ae24ae69..8a672766f05f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6130,6 +6130,21 @@ For more information see Documentation/mm/slub.rst. (slub_nomerge legacy name also accepted for now) + slub.leak_panic= [MM, SLUB] + Enabling slub.leak_panic can monitor the slub usage + in real time on the slub allocation path. When the + slub occupancy is abnormal, the alarm or panic will + be triggered. + Default: N + + slub.leak_panic_threshold= [MM, SLUB] + Upper limit value of the slub usage, expressed as + a percentage of memtotal. When the usage exceeds + the set value (threshold * memtotal / 100), the + slub_leak_panic function will be trigger. The + value setting range is [0, 100]. + Default: 0 + slram= [HW,MTD] smart2= [HW]