Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 04:58:14PM +0200, Michal Hocko wrote: > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > [...] > > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > > index 97a9373e61e8..37c422df2a0f 100644 > > --- a/include/linux/gfp.h > > +++ b/include/linux/gfp.h > > @@ -30,6

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 03:46:20PM +0200, Michal Hocko wrote: > On Wed 06-05-15 09:16:22, Johannes Weiner wrote: > > On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > > > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > > > Not all kmem allocations should be accounted to memcg.

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: [...] > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > index 97a9373e61e8..37c422df2a0f 100644 > --- a/include/linux/gfp.h > +++ b/include/linux/gfp.h > @@ -30,6 +30,7 @@ struct vm_area_struct; > #define ___GFP_HARDWALL

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 17:29:51, Vladimir Davydov wrote: [...] > My point is that MEMCG is the only subsystem of the kernel that tries to > do full memory accounting, and there is no point in introducing another > one, because we already have it. Then I really do not get why the gfp flag cannot be

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 03:55:20PM +0200, Michal Hocko wrote: > On Wed 06-05-15 16:25:10, Vladimir Davydov wrote: > > On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: [...] > > > NOACCOUNT doesn't imply kmem at all so it is not clear who is in charge > > > of the accounting. > > > >

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 16:25:10, Vladimir Davydov wrote: > On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: > > On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: [...] > > > I don't think making this flag per-cache is an option either, but for > > > another reason - it would not be possible

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 09:16:22, Johannes Weiner wrote: > On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > > Not all kmem allocations should be accounted to memcg. The following > > > patch gives an example when accounting of a

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: > On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: > > On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > > > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > > > Not all kmem allocations should be accounted to memcg.

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > Not all kmem allocations should be accounted to memcg. The following > > patch gives an example when accounting of a certain type of allocations > > to memcg can effectively result

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: > On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > > Not all kmem allocations should be accounted to memcg. The following > > > patch gives an example when accounting of a

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: > On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > > Not all kmem allocations should be accounted to memcg. The following > > patch gives an example when accounting of a certain type of allocations > > to memcg can effectively result

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: > Not all kmem allocations should be accounted to memcg. The following > patch gives an example when accounting of a certain type of allocations > to memcg can effectively result in a memory leak. > This patch adds the __GFP_NOACCOUNT flag which

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of allocations to memcg can effectively result in a memory leak. This patch adds the __GFP_NOACCOUNT flag which if

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of allocations to memcg can effectively result in a

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of allocations to memcg can effectively result in a

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 16:25:10, Vladimir Davydov wrote: On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: [...] I don't think making this flag per-cache is an option either, but for another reason - it would not be possible to merge

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: On Wed 06-05-15 15:24:31, Vladimir Davydov wrote: On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 09:16:22, Johannes Weiner wrote: On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Wed 06-05-15 17:29:51, Vladimir Davydov wrote: [...] My point is that MEMCG is the only subsystem of the kernel that tries to do full memory accounting, and there is no point in introducing another one, because we already have it. Then I really do not get why the gfp flag cannot be specific

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Vladimir Davydov
On Wed, May 06, 2015 at 03:55:20PM +0200, Michal Hocko wrote: On Wed 06-05-15 16:25:10, Vladimir Davydov wrote: On Wed, May 06, 2015 at 02:35:41PM +0200, Michal Hocko wrote: [...] NOACCOUNT doesn't imply kmem at all so it is not clear who is in charge of the accounting. IMO it is a

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 04:58:14PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: [...] diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 97a9373e61e8..37c422df2a0f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -30,6 +30,7 @@

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Johannes Weiner
On Wed, May 06, 2015 at 03:46:20PM +0200, Michal Hocko wrote: On Wed 06-05-15 09:16:22, Johannes Weiner wrote: On Wed, May 06, 2015 at 01:59:41PM +0200, Michal Hocko wrote: On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: Not all kmem allocations should be accounted to memcg. The

Re: [PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-06 Thread Michal Hocko
On Tue 05-05-15 12:45:42, Vladimir Davydov wrote: [...] diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 97a9373e61e8..37c422df2a0f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -30,6 +30,7 @@ struct vm_area_struct; #define ___GFP_HARDWALL 0x2u

[PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-05 Thread Vladimir Davydov
Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of allocations to memcg can effectively result in a memory leak. This patch adds the __GFP_NOACCOUNT flag which if passed to kmalloc and friends will force the allocation

[PATCH 1/2] gfp: add __GFP_NOACCOUNT

2015-05-05 Thread Vladimir Davydov
Not all kmem allocations should be accounted to memcg. The following patch gives an example when accounting of a certain type of allocations to memcg can effectively result in a memory leak. This patch adds the __GFP_NOACCOUNT flag which if passed to kmalloc and friends will force the allocation