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

2021-03-02 Thread Roman Gushchin
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

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

2021-03-02 Thread Michal Hocko
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

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

2021-03-02 Thread Roman Gushchin
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()

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

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 06:02:14, Shakeel Butt wrote: > On Mon, Mar 1, 2021 at 11:52 PM 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

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

2021-03-02 Thread Shakeel Butt
On Mon, Mar 1, 2021 at 11:52 PM 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(). Instead of __GFP_THISNODE, mention that the

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

2021-03-02 Thread Shakeel Butt
On Tue, Mar 2, 2021 at 1:34 AM Michal Hocko wrote: > [snip] > > Yeah, imprecision may > > not be a problem. But if this is what we did deliberately, I think that > > it is better to add a comment there. Thanks. > > Yes the comment is quite confusing. I suspect it meant to say > /* All

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

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 5:34 PM Michal Hocko wrote: > > On Tue 02-03-21 17:23:42, Muchun Song wrote: > > On Tue, Mar 2, 2021 at 4:44 PM Michal Hocko wrote: > > > > > > On Tue 02-03-21 15:37:33, Muchun Song wrote: > > > > The alloc_thread_stack_node() cannot guarantee that allocated stack > > > >

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

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 17:23:42, Muchun Song wrote: > On Tue, Mar 2, 2021 at 4:44 PM Michal Hocko wrote: > > > > On Tue 02-03-21 15:37:33, 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

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

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 4:44 PM Michal Hocko wrote: > > On Tue 02-03-21 15:37:33, 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

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

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 15:37:33, 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

[PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Muchun Song
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. Fixes: 991e7673859e ("mm: memcontrol: