From 49e2a3d8566688ef6fe49bb4dfc0a4eb418869e7 Mon Sep 17 00:00:00 2001 From: "Vlastimil Babka (SUSE)" Date: Mon, 25 May 2026 09:26:39 +0200 Subject: [PATCH 1/4] MAINTAINERS: add slab-related scripts and tools to SLAB ALLOCATOR Make sure the maintainers and reviewers are CC'd on changes to the scripts and tools that depend on slab internals. Link: https://patch.msgid.link/20260525-maint-slab-tools-v1-1-d66b69f1412a@kernel.org Acked-by: Harry Yoo (Oracle) Acked-by: SeongJae Park Signed-off-by: Vlastimil Babka (SUSE) --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2040011a386..03f66faebd30 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24612,6 +24612,12 @@ F: mm/mempool.c F: mm/slab.h F: mm/slab_common.c F: mm/slub.c +F: scripts/gdb/linux/slab.py +F: tools/cgroup/memcg_slabinfo.py +F: tools/include/linux/slab.h +F: tools/lib/slab.c +F: tools/mm/slabinfo-gnuplot.sh +F: tools/mm/slabinfo.c SLCAN CAN NETWORK DRIVER M: Dario Binacchi From 235ab68d67eadbef1fdbfb771f21f5bacc77a2ae Mon Sep 17 00:00:00 2001 From: Xuewen Wang Date: Mon, 18 May 2026 14:21:57 +0800 Subject: [PATCH 2/4] tools/mm/slabinfo: Fix trace disable logic inversion The disable trace path in slab_debug() had a logic error where it would set trace=1 instead of trace=0. This made trace functionality permanently enabled once turned on for any slab cache. Fixes: a87615b8f9e2 ("SLUB: slabinfo upgrade") Cc: stable@vger.kernel.org Reviewed-by: SeongJae Park Signed-off-by: Xuewen Wang WARNING: From:/Signed-off-by: email address mismatch: 'From: wangxuewen <18810879172@163.com>' != 'Signed-off-by: wangxuewen ' Link: https://patch.msgid.link/20260518062159.80664-2-wangxuewen@kylinos.cn Signed-off-by: Vlastimil Babka (SUSE) --- tools/mm/slabinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c index 54c7265ab52d..39f7eae7eecd 100644 --- a/tools/mm/slabinfo.c +++ b/tools/mm/slabinfo.c @@ -798,7 +798,7 @@ static void slab_debug(struct slabinfo *s) fprintf(stderr, "%s can only enable trace for one slab at a time\n", s->name); } if (!tracing && s->trace) - set_obj(s, "trace", 1); + set_obj(s, "trace", 0); } static void totals(void) From 76c2db064bc11dd13b0a6c078414b0a62b8128f5 Mon Sep 17 00:00:00 2001 From: Xuewen Wang Date: Mon, 18 May 2026 14:21:58 +0800 Subject: [PATCH 3/4] tools/mm/slabinfo: remove dead assignment in get_obj_and_str() The assignment `x = NULL` sets the local parameter variable instead of `*x`, which is a no-op since `*x` was already set to NULL on the line above. Remove the dead assignment. Signed-off-by: Xuewen Wang Reviewed-by: SeongJae Park Link: https://patch.msgid.link/20260518062159.80664-3-wangxuewen@kylinos.cn Signed-off-by: Vlastimil Babka (SUSE) --- tools/mm/slabinfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c index 39f7eae7eecd..685bcdd03568 100644 --- a/tools/mm/slabinfo.c +++ b/tools/mm/slabinfo.c @@ -193,10 +193,9 @@ static unsigned long get_obj_and_str(const char *name, char **x) *x = NULL; - if (!read_obj(name)) { - x = NULL; + if (!read_obj(name)) return 0; - } + result = strtoul(buffer, &p, 10); while (*p == ' ') p++; From 2b685ac24aede39cb37fa29f44ffc133b19bfe81 Mon Sep 17 00:00:00 2001 From: Xuewen Wang Date: Mon, 18 May 2026 14:21:59 +0800 Subject: [PATCH 4/4] tools/mm/slabinfo: remove redundant slab->partial assignment slab->partial is assigned by get_obj("partial") and then immediately overwritten by get_obj_and_str("partial", &t). Remove the first redundant assignment. Reviewed-by: SeongJae Park Signed-off-by: Xuewen Wang Link: https://patch.msgid.link/20260518062159.80664-4-wangxuewen@kylinos.cn Signed-off-by: Vlastimil Babka (SUSE) --- tools/mm/slabinfo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c index 685bcdd03568..87570c22b151 100644 --- a/tools/mm/slabinfo.c +++ b/tools/mm/slabinfo.c @@ -1265,7 +1265,6 @@ static void read_slab_dir(void) slab->objects_total = get_obj("objects_total"); slab->objs_per_slab = get_obj("objs_per_slab"); slab->order = get_obj("order"); - slab->partial = get_obj("partial"); slab->partial = get_obj_and_str("partial", &t); decode_numa_list(slab->numa_partial, t); free(t);