Re: [PATCH slab/for-next v2 01/14] mm/slab: allow passing SLAB_MAY_ACCOUNT to kmem_cache_create()

From: Hao Li

Date: Thu Dec 03 2026 - 09:24:31 EST


On Wed, Nov 25, 2026 at 09:37:02PM +0000, Harry Yoo (Meta) wrote:
> Callers will specify SLAB_MAY_ACCOUNT for caches whose objects may be
> allocated with __GFP_ACCOUNT. Accept the flag in SLAB_CORE_FLAGS.
>
> SLAB_MAY_ACCOUNT prevents merging but is not part of the sysfs ID. This
> was fine while all mergeable caches had the flag. Now that callers may
> specify it, encode it in create_unique_id() to keep the ID unique.
>
> Define the flag in tools/ as well to avoid breaking the userspace tests.
>
> Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
> ---
> mm/slab.h | 2 +-
> mm/slub.c | 2 ++
> tools/include/linux/slab.h | 3 +++
> 3 files changed, 6 insertions(+), 1 deletion(-)

Looks good to me.
Reviewed-by: Hao Li <hao.li@xxxxxxxxx>

--
Thanks,
Hao