Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-24 Thread Tejun Heo
Hello, On Mon, Sep 24, 2012 at 01:09:23PM +0400, Glauber Costa wrote: > > I can't say I'm a big fan of this approach. If there are enough > > users, maybe but can't we just annotate the affected allocations > > explicitly? Is this gonna have many more users? > > What exactly do you mean by

Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-24 Thread Glauber Costa
On 09/21/2012 11:59 PM, Tejun Heo wrote: > Hello, > > On Tue, Sep 18, 2012 at 06:12:01PM +0400, Glauber Costa wrote: >> +static void memcg_stop_kmem_account(void) >> +{ >> +if (!current->mm) >> +return; >> + >> +current->memcg_kmem_skip_account++; >> +} >> + >> +static void

Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-24 Thread Glauber Costa
On 09/21/2012 11:59 PM, Tejun Heo wrote: Hello, On Tue, Sep 18, 2012 at 06:12:01PM +0400, Glauber Costa wrote: +static void memcg_stop_kmem_account(void) +{ +if (!current-mm) +return; + +current-memcg_kmem_skip_account++; +} + +static void

Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-24 Thread Tejun Heo
Hello, On Mon, Sep 24, 2012 at 01:09:23PM +0400, Glauber Costa wrote: I can't say I'm a big fan of this approach. If there are enough users, maybe but can't we just annotate the affected allocations explicitly? Is this gonna have many more users? What exactly do you mean by annotating

Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-21 Thread Tejun Heo
Hello, On Tue, Sep 18, 2012 at 06:12:01PM +0400, Glauber Costa wrote: > +static void memcg_stop_kmem_account(void) > +{ > + if (!current->mm) > + return; > + > + current->memcg_kmem_skip_account++; > +} > + > +static void memcg_resume_kmem_account(void) > +{ > + if

Re: [PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-21 Thread Tejun Heo
Hello, On Tue, Sep 18, 2012 at 06:12:01PM +0400, Glauber Costa wrote: +static void memcg_stop_kmem_account(void) +{ + if (!current-mm) + return; + + current-memcg_kmem_skip_account++; +} + +static void memcg_resume_kmem_account(void) +{ + if (!current-mm) +

[PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-18 Thread Glauber Costa
This patch creates a mechanism that skip memcg allocations during certain pieces of our core code. It basically works in the same way as preempt_disable()/preempt_enable(): By marking a region under which all allocations will be accounted to the root memcg. We need this to prevent races in early

[PATCH v3 07/16] memcg: skip memcg kmem allocations in specified code regions

2012-09-18 Thread Glauber Costa
This patch creates a mechanism that skip memcg allocations during certain pieces of our core code. It basically works in the same way as preempt_disable()/preempt_enable(): By marking a region under which all allocations will be accounted to the root memcg. We need this to prevent races in early