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

From: Harry Yoo (Meta)

Date: Wed Oct 21 2026 - 07:51:23 EST


Callers will specify SLAB_MAY_ACCOUNT for caches whose objects may be
allocated with __GFP_ACCOUNT. Accept the flag in SLAB_CORE_FLAGS.

Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
---
mm/slab.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab.h b/mm/slab.h
index e94ac63d10dc..31783311e23e 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -472,7 +472,7 @@ void flush_rcu_sheaves_on_cache(struct kmem_cache *s);
SLAB_CACHE_DMA32 | SLAB_PANIC | \
SLAB_TYPESAFE_BY_RCU | SLAB_DEBUG_OBJECTS | \
SLAB_NOLEAKTRACE | SLAB_RECLAIM_ACCOUNT | \
- SLAB_TEMPORARY | SLAB_ACCOUNT | \
+ SLAB_TEMPORARY | SLAB_ACCOUNT | SLAB_MAY_ACCOUNT | \
SLAB_NO_USER_FLAGS | SLAB_KMALLOC | SLAB_NO_MERGE)

#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \

--
2.54.0