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 <ke…@kernel.org> > Cc: David Hildenbrand <dav…@kernel.org> > Cc: Lorenzo Stoakes <l…@kernel.org> > Cc: "Liam R. Howlett" <li…@infradead.org> > Cc: Mike Rapoport <rp…@kernel.org> > Cc: Michal Hocko <mhoc…@suse.com> > Cc: Ingo Molnar <min…@redhat.com> > Cc: Peter Zijlstra <pete…@infradead.org> > Cc: Juri Lelli <juri…@redhat.com> > Cc: Vincent Guittot <vinc…@linaro.org> > Cc: Dietmar Eggemann <diet…@arm.com> > Cc: Steven Rostedt <rost…@goodmis.org> > Cc: Ben Segall <bseg…@google.com> > Cc: Mel Gorman <mgor…@suse.de> > Cc: Valentin Schneider <vsch…@redhat.com> > Cc: K Prateek Nayak <kpra…@amd.com> > Signed-off-by: Harry Yoo (Meta) <har…@kernel.org> > --- > kernel/fork.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >
Looks good to me. Reviewed-by: Hao Li <hao…@linux.dev>
-- Thanks, Hao