Re: [PATCH slab/for-next v2 06/14] kernel/fork: specify SLAB_MAY_ACCOUNT for thread_stack cache

From: Hao Li

Date: Thu Dec 03 2026 - 09:53:28 EST


On Wed, Nov 25, 2026 at 09:37:07PM +0000, Harry Yoo (Meta) wrote:
> When THREAD_SIZE < PAGE_SIZE, thread stacks are allocated from a slab
> cache with THREADINFO_GFP, which includes __GFP_ACCOUNT. Specify
> SLAB_MAY_ACCOUNT when the object may be charged to a memcg.
> __GFP_ACCOUNT without SLAB_MAY_ACCOUNT will not be allowed.
>
> Path (e.g. ppc64le, 64K pages, !VMAP_STACK): copy_process()
> -> dup_task_struct() -> alloc_thread_stack_node()
> -> kmem_cache_alloc_node(thread_stack_cache, THREADINFO_GFP)
>
> Cc: Kees Cook <kees@xxxxxxxxxx>
> Cc: David Hildenbrand <david@xxxxxxxxxx>
> Cc: Lorenzo Stoakes <ljs@xxxxxxxxxx>
> Cc: "Liam R. Howlett" <liam@xxxxxxxxxxxxx>
> Cc: Mike Rapoport <rppt@xxxxxxxxxx>
> Cc: Michal Hocko <mhocko@xxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
> Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Ben Segall <bsegall@xxxxxxxxxx>
> Cc: Mel Gorman <mgorman@xxxxxxx>
> Cc: Valentin Schneider <vschneid@xxxxxxxxxx>
> Cc: K Prateek Nayak <kprateek.nayak@xxxxxxx>
> Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
> ---
> kernel/fork.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

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

--
Thanks,
Hao