Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Shakeel Butt
On Thu, Sep 7, 2017 at 11:47 AM, Roman Gushchin wrote: > On Thu, Sep 07, 2017 at 11:44:12AM -0700, Shakeel Butt wrote: >> >> As far as other types of pages go: page cache and anon are already >> >> batched pretty well, but I think kmem might benefit from this >> >> too. Have you

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Shakeel Butt
On Thu, Sep 7, 2017 at 11:47 AM, Roman Gushchin wrote: > On Thu, Sep 07, 2017 at 11:44:12AM -0700, Shakeel Butt wrote: >> >> As far as other types of pages go: page cache and anon are already >> >> batched pretty well, but I think kmem might benefit from this >> >> too. Have you considered using

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Roman Gushchin
On Thu, Sep 07, 2017 at 11:44:12AM -0700, Shakeel Butt wrote: > >> As far as other types of pages go: page cache and anon are already > >> batched pretty well, but I think kmem might benefit from this > >> too. Have you considered using the stock in memcg_kmem_uncharge()? > > > > Good idea! > >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Roman Gushchin
On Thu, Sep 07, 2017 at 11:44:12AM -0700, Shakeel Butt wrote: > >> As far as other types of pages go: page cache and anon are already > >> batched pretty well, but I think kmem might benefit from this > >> too. Have you considered using the stock in memcg_kmem_uncharge()? > > > > Good idea! > >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Shakeel Butt
>> As far as other types of pages go: page cache and anon are already >> batched pretty well, but I think kmem might benefit from this >> too. Have you considered using the stock in memcg_kmem_uncharge()? > > Good idea! > I'll try to find an appropriate testcase and check if it really > brings any

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-09-07 Thread Shakeel Butt
>> As far as other types of pages go: page cache and anon are already >> batched pretty well, but I think kmem might benefit from this >> too. Have you considered using the stock in memcg_kmem_uncharge()? > > Good idea! > I'll try to find an appropriate testcase and check if it really > brings any

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > We've noticed a quite sensible performance overhead on some hosts > with significant network traffic when socket memory accounting > is enabled. > > Perf top shows that socket memory uncharging path is hot: > 2.13% [kernel][k]

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > We've noticed a quite sensible performance overhead on some hosts > with significant network traffic when socket memory accounting > is enabled. > > Perf top shows that socket memory uncharging path is hot: > 2.13% [kernel][k]

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Wed 30-08-17 13:57:29, Roman Gushchin wrote: > On Wed, Aug 30, 2017 at 02:55:43PM +0200, Michal Hocko wrote: > > On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > > > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > > >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Wed 30-08-17 13:57:29, Roman Gushchin wrote: > On Wed, Aug 30, 2017 at 02:55:43PM +0200, Michal Hocko wrote: > > On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > > > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > > >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Wed, Aug 30, 2017 at 02:55:43PM +0200, Michal Hocko wrote: > On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > > [...] > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Wed, Aug 30, 2017 at 02:55:43PM +0200, Michal Hocko wrote: > On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > > [...] > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > [...] > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > index b9cf3cf4a3d0..a69d23082abf 100644 > > > ---

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Wed 30-08-17 13:44:59, Roman Gushchin wrote: > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > > [...] > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > index b9cf3cf4a3d0..a69d23082abf 100644 > > > ---

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > [...] > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index b9cf3cf4a3d0..a69d23082abf 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1792,6 +1792,9 @@

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote: > On Tue 29-08-17 11:01:50, Roman Gushchin wrote: > [...] > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index b9cf3cf4a3d0..a69d23082abf 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1792,6 +1792,9 @@

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Tue 29-08-17 11:01:50, Roman Gushchin wrote: [...] > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index b9cf3cf4a3d0..a69d23082abf 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -1792,6 +1792,9 @@ static void refill_stock(struct mem_cgroup *memcg, > unsigned int nr_pages) >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Michal Hocko
On Tue 29-08-17 11:01:50, Roman Gushchin wrote: [...] > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index b9cf3cf4a3d0..a69d23082abf 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -1792,6 +1792,9 @@ static void refill_stock(struct mem_cgroup *memcg, > unsigned int nr_pages) >

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Tue, Aug 29, 2017 at 03:26:21PM -0400, Johannes Weiner wrote: > On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > > We've noticed a quite sensible performance overhead on some hosts > > with significant network traffic when socket memory accounting > > is enabled. > > > > Perf

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Tue, Aug 29, 2017 at 03:26:21PM -0400, Johannes Weiner wrote: > On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > > We've noticed a quite sensible performance overhead on some hosts > > with significant network traffic when socket memory accounting > > is enabled. > > > > Perf

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Tue, Aug 29, 2017 at 03:26:21PM -0400, Johannes Weiner wrote: > On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > > We've noticed a quite sensible performance overhead on some hosts > > with significant network traffic when socket memory accounting > > is enabled. > > > > Perf

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-30 Thread Roman Gushchin
On Tue, Aug 29, 2017 at 03:26:21PM -0400, Johannes Weiner wrote: > On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > > We've noticed a quite sensible performance overhead on some hosts > > with significant network traffic when socket memory accounting > > is enabled. > > > > Perf

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-29 Thread Johannes Weiner
On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > We've noticed a quite sensible performance overhead on some hosts > with significant network traffic when socket memory accounting > is enabled. > > Perf top shows that socket memory uncharging path is hot: > 2.13% [kernel]

Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging

2017-08-29 Thread Johannes Weiner
On Tue, Aug 29, 2017 at 11:01:50AM +0100, Roman Gushchin wrote: > We've noticed a quite sensible performance overhead on some hosts > with significant network traffic when socket memory accounting > is enabled. > > Perf top shows that socket memory uncharging path is hot: > 2.13% [kernel]