From patchwork Wed Sep 25 13:25:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13812010 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 7717DCF58C7 for ; Wed, 25 Sep 2024 13:27:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 097256B00AB; Wed, 25 Sep 2024 09:27:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01C9B6B00AD; Wed, 25 Sep 2024 09:27:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD7F36B00B0; Wed, 25 Sep 2024 09:27:07 -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 BCDDB6B00AB for ; Wed, 25 Sep 2024 09:27:07 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 845D1160340 for ; Wed, 25 Sep 2024 13:27:07 +0000 (UTC) X-FDA: 82603336494.24.2731A0C Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf10.hostedemail.com (Postfix) with ESMTP id EE3EAC0016 for ; Wed, 25 Sep 2024 13:27:04 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.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=1727270666; 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=FV74NueAu5SeBnT2ueEjQkrpfaJqbpTs0j3PgeWocgI=; b=JbNv73mhzaRpdbwuhjPpWrneL3ty9rRYq7QCbIJ/tOc9VcaxMLemmVeDeJT/QoYa/th5j6 nv0grYVqKHf6pNHvUIh5gbSUUXp/Gje/+sNmCj2+YbFGYHlcNVqMZ1ALCZrOxdng1MB/Kn nquGbLZ9FDdfyFqPI2SgMMn0qmzHtSw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727270666; a=rsa-sha256; cv=none; b=QuLK+C9oodMe8Kq/GkjFwtuNwXYPYZbyNlxdCGgmX0vzyCSCIyzKLGSyzIgp03p0LIrQv0 xKV6eXeIg32Yb0+J08PZc+KFWhH7leNwC3itTrRvXSYwiax98SYnVvhvSpZUZ5oJkEAEvb 4ukTBq7JGOide46EhiDSLPk74085H7Y= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 48PDPFXv032094; Wed, 25 Sep 2024 21:25:15 +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 4XDHMZ6jRrz2K5B73; Wed, 25 Sep 2024 21:17: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 21:25:13 +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 V2 1/2] mm/slub: Add panic function when slub leaks Date: Wed, 25 Sep 2024 21:25:04 +0800 Message-ID: <20240925132505.21278-2-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240925132505.21278-1-fangzheng.zhang@unisoc.com> References: <20240925132505.21278-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 48PDPFXv032094 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: EE3EAC0016 X-Stat-Signature: a497zccp3hgazfopceori9i3jodxeobi X-Rspam-User: X-HE-Tag: 1727270824-685077 X-HE-Meta: U2FsdGVkX1+IlJl+4XzOptXflKzgwxmeIsIgG5kdcHX+k/yk86E6qM/tMAAjJT1qKBSPr7mvXXdrw8V0onJzL6g+dXuoYjNeZr6huDqH5QnEIjsHwhjw3K/V77DgRfdf87tx3RiATlZSc6YH7HcCX+UOojssVWpaEe05UuoyOkbVFWuoGaViA2IFDqm5Z2k1EZDMxZzGo5o1LIaJIo3/0gMIE9FX9YN9wG7bbpd+urQ1dYUvyp4s0eiwql4RAuhjvPe3/Po0VTALJ3h8BGhXbFpj+/gG5yUw1fwtajob1uBI++Kuj0TGFlIAk1tV9vU2V7SEzt3pzEAdgRDuYczaHQuEkhtj2IJ6Ugd+8Oz6yoiVgln1gB182rkVDcFKtWcwKLuRxVk2w14bkRwdBAgTMKYiOi8X0QO4p+DB7c3+ZJ5b9Uo7tIsNsm9tk2RqYfZ7AEkIrsi0FgqnKsn3tURXJ7oYZ/PVYv1exzTER6ExkXijEG/cIgAWV0O4U7qrUHhrpmDAL391z630/pFq9UzIoxwMsMLKsxL0gy2Rg2soR9lsSvk5eYU0mK/JDgrwsxHJz2cVRTJLFCwU8HRKUzi5D2fhxOforl5bTa4w1Xz19a8oL6Gn7ra/yD2ngA45/PH4Wl80QUxfWv8GbSAaYFnmh3ZR/hwTr8xDVwaWqmkTcqI9x+Qf75plUHG+zHrLpfnX1QbQYMklPq+GXTk63Cu3b4J0rjMPqVgHL4/6NjGTF4WolPtJK4y2daAz48yTGUpFtlcYmsfSOATXzxSr8nRyzZd0wu3ICZaVRvR00jM19qhDMH3CvI/6uiZFi9KptxrgLzwi3iCr4dRs0+Cgbnf9hNHAbzllskxs17MnyGcKP2Nh7I2UsmOdSyZdX4CBin+eEuwQpvAdCjNe5OJ3Tdum8yiccsqcb4YMvSXa9FuyFzSdhj0jEaqPDMjYMjuM/ESdIZMdfJEbOzxh1kVE0oe cnFQVkCg jpV23CZE8zp3kEi3+KAnhmDZtbageLpPRKnNxHYqy39r5IDzouMKfH6ZC1mPvlLziV1Bqr8GqkLMLfbVfKwaTQ8Q5Sk+xZIYLHWdhCZkN+R21bJHxZTn0wH6p7HWFx+v6u7IdYJQNl9NE3xNxzf5J+HbFPS2c7f3qrJQxs8gWR+CdgLQK0ZMNRpP76hGlMIh0YqPUqGIep5bTfKucqDk57cDq9OYEjXjfn65xE2cKtyNPWjaXz6Z6g7yOsE2hBBnW2hxGpRtIONHUBIJKe8p3V2MGtSs5WAG1v/rNDYDOtwaGEt8= 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 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) 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..a0b514626de1 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -218,6 +219,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 +2434,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 +4237,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 +7481,40 @@ 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); +#endif /* CONFIG_SLUB_LEAK_PANIC */ From patchwork Wed Sep 25 13:25:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13812015 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 210ADCF58C7 for ; Wed, 25 Sep 2024 13:32:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 921C06B00AB; Wed, 25 Sep 2024 09:32:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D5296B00AD; Wed, 25 Sep 2024 09:32:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 798CE6B00AF; Wed, 25 Sep 2024 09:32:06 -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 595C26B00AB for ; Wed, 25 Sep 2024 09:32:06 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 01919AC210 for ; Wed, 25 Sep 2024 13:32:05 +0000 (UTC) X-FDA: 82603349052.30.C6710AD Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf11.hostedemail.com (Postfix) with ESMTP id 816CC40018 for ; Wed, 25 Sep 2024 13:32:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.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=1727270988; 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=B93qdgWILMqVd8cgueQN7FUVq5b6rMayRcy3UR4i7M5JdVJ+iBlsN6Hkg/MlawGytqTLB4 6afXrKlktwhJZRkZ3V7ePPhI1px+Lc+uPTOdgECcPQdsPUy1p1G6Z99qFXLs31aNRNCkSR jpbii7U69NPOGLZCt2Et0WmI/oyQVrI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727270988; a=rsa-sha256; cv=none; b=YxbdFM+UG+zuK3ZoW7kK0Tp9mz2XQfsvUkbbcczpZFct7v3tw4ZJqGstUlKd/w6+6F6uOZ OVviwOnHDdt4M3myaWwaQsHIXgKyGuht0yGVGouv27rmOw8tThY/GSjm8bj4NQrGwq+pND nlGWC8rajwkeA83t3URrVPV+LO9vT04= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 48PDPKph032238; Wed, 25 Sep 2024 21:25:20 +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 4XDHMg1QHxz2QHjcP; Wed, 25 Sep 2024 21:17:35 +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 21:25:17 +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 V2 2/2] Documentation: admin-guide: kernel-parameters: Add parameter description for slub_leak_panic function Date: Wed, 25 Sep 2024 21:25:05 +0800 Message-ID: <20240925132505.21278-3-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240925132505.21278-1-fangzheng.zhang@unisoc.com> References: <20240925132505.21278-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 48PDPKph032238 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 816CC40018 X-Stat-Signature: re7s5pfa7wacguh1p4nwb37nwjera1kn X-Rspam-User: X-HE-Tag: 1727271120-687589 X-HE-Meta: U2FsdGVkX18svXI/qEmgsnmH/FKhsIRZPz+SzFwStDgpaAL1nFsfg93ggGPkaGb3ms2Kf0nl/tawkb1Kg4snT4xOLij/WzhtmnTMUECpSAIsxIohsfEzHZmgR/h9KtjQ4KRritdpXTa1Uik5PGGLoNW4cfKh5xAsukksRvmYPh8/YxAEQveDHBB8hwoeGU5/syzsH1lbhY5ktA39GsQxBX+8UZlV5oNWs7hHw1z0HqD40Moi6Ackkh4pBjCp2PT8vZiSvlX9Mk3VnWP0ECVGet/W1qClaFXrGJG48J9zEpWW/jzSFYLCQWg0WNolzHm7vGPZgT1Gp663UkV+759gbNAy4hdqzWJvDfAZ+ujwkKhUVTiGHZp7zE/iRAcsRC0ArFVnLkbzxtNHVbk2CPLjVPgKWolHGXXB6T/6ge4TqI42n/H2WZlR3IwkOKQJvUjg8rISJSJJ/eQ+IHzxdZ9BnqSMmR0Gpm8/B37FtbxMoVBz/OH2qZupAl3htYXGNVROQH2yM1nl/qOCQh++6wx34ocKWl1KOBXVyay0Jss2+Z8CMgOVqbtcHrVNs6qLCYGzu6ttFdLx5E2gS5qGrGzUkSb5FftGSblhdlvvzqfarnpsbzxxKJPUa+8m4676rdnU4O5SbgxZghDg+A1IbRrju6VLF07+KZpsC+6j8ZBTnq3lw8SfwlXxQfLIQLuLdg4hUkDH4Y3g8rRX9bLAZKc35LWKoytaoLggDne5LK8hmsd8/bj8suTcUTeAYN02S+HUAnBFQ7wMjav14Wy5xo3O2MVFZXscHgkkGWj8tuh2d6d4ZY0PTTTHMsSHQPrpOKg9Kmaao9qGUPpL6TYSljl8q75G4h93GOIOGG0bmVjw9nndUUk8Ubrd/bt5cgLpLbVA5JuA3QaxhYrVQGCfQmuV2/V2NcDFF8XgELgqrZtlxJBJT74baOuqJtMFucbatesb6C0yPb4Gtfayi8w0M23 FvQsQ9Cr OBxhdcCElwxfAO0XJqSA3Ht6z6a/gOK50ggFTEeKFwKvvGn+VRpgR+dk/TlvSUTJjP0rUaUbEKo6knWXFKdMpKtUve9J8VKwwLNCY4cFUBC0Znbl/3rqpm2D8N8nDkZpVYPx8UGDsOEUuT8RkP5/+DTgD2defRnpP9RnCgN1Tj7UlH7fD3QaE8oawz1AbBRcCt8KRkmZJqB/YM1yKAZQXl/8LGElblA9xOjMMed8K3Xh9xh4b+rGMN+621boh7s4SJOibAUE2VxOIXGGsuVTWSWLMGl2LuCngn0nNbsyjeIcOwWVLLfD+6A8+pY7+UXNxuRvUP6S/NmyUb7DnbAqWuQgXkQ== 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]