Re: [PATCH] mm: memcontrol: fix kernel stack account

From: Roman Gushchin
Date: Tue Mar 02 2021 - 17:39:01 EST


On Tue, Mar 02, 2021 at 08:33:20PM +0100, Michal Hocko wrote:
> On Tue 02-03-21 10:50:32, Roman Gushchin wrote:
> > On Tue, Mar 02, 2021 at 03:37:33PM +0800, Muchun Song wrote:
> > > The alloc_thread_stack_node() cannot guarantee that allocated stack pages
> > > are in the same node when CONFIG_VMAP_STACK. Because we do not specify
> > > __GFP_THISNODE to __vmalloc_node_range(). Fix it by caling
> > > mod_lruvec_page_state() for each page one by one.
> >
> > Hm, I actually wonder if it makes any sense to split the stack over multiple
> > nodes? Maybe we should fix this instead?
>
> While this is not really ideal I am not really sure it is an actual
> problem worth complicating the code. I am pretty sure this would grow
> into more tricky problem quite quickly (e.g. proper memory policy
> handling).

I'd agree and IMO accounting a couple of pages to a different node
is even a smaller problem.