Re: [PATCH] mm/slub: unify slub stat definitions to simplify metric additions
From: Vlastimil Babka (SUSE)
Date: Mon Sep 07 2026 - 11:09:40 EST
On 8/14/26 09:17, Hao Li wrote:
> Currently, adding a new slub stat requires modifying three separate
> locations: stat_item, STAT_ATTR, and slab_attrs. This is inconvenient,
> especially when temporarily adding metrics for debugging during
> development.
>
> This patch borrows the approach from SCHED_FEAT by introducing an ITEM_EXP
> X-macro, which is then temporarily defined as different operations at the
> three locations (stat_item, STAT_ATTR, and slab_attrs) to perform distinct
> macro expansions.
>
> Going forward, adding a new metric only requires adding a single line:
> ITEM_EXP(XXX, xxx)
>
> Signed-off-by: Hao Li <hao.li@xxxxxxxxx>
Nice, thanks! Added to mm/slab.git slab/for-7.4/misc -> slab/for-next