Skip to content

Commit 5b535bd

Browse files
chenyichong1gregkh
authored andcommitted
tools/mm/slabinfo: fix total_objects attribute name
commit 892a786 upstream. SLUB exports the total_objects sysfs attribute, but slabinfo tries to read objects_total. As a result, the lookup fails and the field remains zero. Use the correct attribute name and rename the corresponding structure member to match. Fixes: 205ab99 ("slub: Update statistics handling for variable order slabs") Signed-off-by: Yichong Chen <chenyichong@uniontech.com> Cc: <stable@vger.kernel.org> Reviewed-by: SeongJae Park <sj@kernel.org> Link: https://patch.msgid.link/96556748872BB47E+20260612071359.649946-1-chenyichong@uniontech.com Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d2468e2 commit 5b535bd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/mm/slabinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct slabinfo {
3333
unsigned int hwcache_align, object_size, objs_per_slab;
3434
unsigned int sanity_checks, slab_size, store_user, trace;
3535
int order, poison, reclaim_account, red_zone;
36-
unsigned long partial, objects, slabs, objects_partial, objects_total;
36+
unsigned long partial, objects, slabs, objects_partial, total_objects;
3737
unsigned long alloc_fastpath, alloc_slowpath;
3838
unsigned long free_fastpath, free_slowpath;
3939
unsigned long free_frozen, free_add_partial, free_remove_partial;
@@ -1256,7 +1256,7 @@ static void read_slab_dir(void)
12561256
slab->object_size = get_obj("object_size");
12571257
slab->objects = get_obj("objects");
12581258
slab->objects_partial = get_obj("objects_partial");
1259-
slab->objects_total = get_obj("objects_total");
1259+
slab->total_objects = get_obj("total_objects");
12601260
slab->objs_per_slab = get_obj("objs_per_slab");
12611261
slab->order = get_obj("order");
12621262
slab->partial = get_obj("partial");

0 commit comments

Comments
 (0)