Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-29 Thread Shakeel Butt
On Wed, Aug 29, 2018 at 2:24 PM Roman Gushchin wrote: > > On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > > using __vmalloc_node_range() with

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-29 Thread Shakeel Butt
On Wed, Aug 29, 2018 at 2:24 PM Roman Gushchin wrote: > > On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > > using __vmalloc_node_range() with

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-29 Thread Roman Gushchin
On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-29 Thread Roman Gushchin
On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Roman Gushchin
On Fri, Aug 24, 2018 at 08:50:52AM -0400, Johannes Weiner wrote: > On Thu, Aug 23, 2018 at 09:23:50AM -0700, Roman Gushchin wrote: > > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > > > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > > > @@ -248,9 +253,20 @@ static unsigned

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Roman Gushchin
On Fri, Aug 24, 2018 at 08:50:52AM -0400, Johannes Weiner wrote: > On Thu, Aug 23, 2018 at 09:23:50AM -0700, Roman Gushchin wrote: > > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > > > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > > > @@ -248,9 +253,20 @@ static unsigned

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Johannes Weiner
On Thu, Aug 23, 2018 at 09:23:50AM -0700, Roman Gushchin wrote: > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > > @@ -248,9 +253,20 @@ static unsigned long *alloc_thread_stack_node(struct > > > task_struct *tsk, int node) > >

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Johannes Weiner
On Thu, Aug 23, 2018 at 09:23:50AM -0700, Roman Gushchin wrote: > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > > @@ -248,9 +253,20 @@ static unsigned long *alloc_thread_stack_node(struct > > > task_struct *tsk, int node) > >

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Michal Hocko
On Thu 23-08-18 09:23:50, Roman Gushchin wrote: > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: [...] > > > @@ -248,9 +253,20 @@ static unsigned long *alloc_thread_stack_node(struct > > > task_struct *tsk, int node) > > > static inline void free_thread_stack(struct task_struct

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-24 Thread Michal Hocko
On Thu 23-08-18 09:23:50, Roman Gushchin wrote: > On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: [...] > > > @@ -248,9 +253,20 @@ static unsigned long *alloc_thread_stack_node(struct > > > task_struct *tsk, int node) > > > static inline void free_thread_stack(struct task_struct

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-23 Thread Roman Gushchin
On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding memory

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-23 Thread Roman Gushchin
On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote: > On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding memory

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-22 Thread Michal Hocko
On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > stack pages are charged against corresponding memory cgroups > on allocation and uncharged on releasing them. > > The problem

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-22 Thread Michal Hocko
On Tue 21-08-18 14:35:57, Roman Gushchin wrote: > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > stack pages are charged against corresponding memory cgroups > on allocation and uncharged on releasing them. > > The problem

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Roman Gushchin
On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Roman Gushchin
On Tue, Aug 21, 2018 at 03:10:52PM -0700, Shakeel Butt wrote: > On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > > stack pages are charged against corresponding

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Shakeel Butt
On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > stack pages are charged against corresponding memory cgroups > on allocation and uncharged on releasing them. > > The

Re: [PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Shakeel Butt
On Tue, Aug 21, 2018 at 2:36 PM Roman Gushchin wrote: > > If CONFIG_VMAP_STACK is set, kernel stacks are allocated > using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel > stack pages are charged against corresponding memory cgroups > on allocation and uncharged on releasing them. > > The

[PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Roman Gushchin
If CONFIG_VMAP_STACK is set, kernel stacks are allocated using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel stack pages are charged against corresponding memory cgroups on allocation and uncharged on releasing them. The problem is that we do cache kernel stacks in small per-cpu caches and

[PATCH v2 1/3] mm: rework memcg kernel stack accounting

2018-08-21 Thread Roman Gushchin
If CONFIG_VMAP_STACK is set, kernel stacks are allocated using __vmalloc_node_range() with __GFP_ACCOUNT. So kernel stack pages are charged against corresponding memory cgroups on allocation and uncharged on releasing them. The problem is that we do cache kernel stacks in small per-cpu caches and