Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-22 Thread Glauber Costa
On 10/22/2012 04:51 PM, Michal Hocko wrote: > [Sorry for the late reply] > > On Mon 22-10-12 16:34:15, Glauber Costa wrote: >> On 10/20/2012 12:34 AM, David Rientjes wrote: >>> On Fri, 19 Oct 2012, Glauber Costa wrote: >>> >>> What about gfp & __GFP_FS? >>> >> >> Do you intend to p

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-22 Thread Michal Hocko
[Sorry for the late reply] On Mon 22-10-12 16:34:15, Glauber Costa wrote: > On 10/20/2012 12:34 AM, David Rientjes wrote: > > On Fri, 19 Oct 2012, Glauber Costa wrote: > > > > What about gfp & __GFP_FS? > > > > Do you intend to prevent or allow OOM under that flag? I personally

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-22 Thread Glauber Costa
On 10/20/2012 12:34 AM, David Rientjes wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > > What about gfp & __GFP_FS? > Do you intend to prevent or allow OOM under that flag? I personally think that anything that accepts to be OOM-killed should have GFP_WAIT set, so

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-19 Thread David Rientjes
On Fri, 19 Oct 2012, Glauber Costa wrote: > >>> What about gfp & __GFP_FS? > >>> > >> > >> Do you intend to prevent or allow OOM under that flag? I personally > >> think that anything that accepts to be OOM-killed should have GFP_WAIT > >> set, so that ought to be enough. > >> > > > > The oom kil

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-19 Thread Glauber Costa
On 10/19/2012 01:59 AM, David Rientjes wrote: > On Thu, 18 Oct 2012, Glauber Costa wrote: > @@ -2630,6 +2634,171 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, memcg_check_events(memcg, page); } +#ifdef CONFIG_MEMCG_KMEM +static inline

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-19 Thread Glauber Costa
On 10/19/2012 01:31 PM, David Rientjes wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > > Do we actually need to test PF_KTHREAD when current->mm == NULL? > Perhaps because of aio threads whcih temporarily adopt a userspace mm? I believe so. I remember I discussed this in th

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-19 Thread David Rientjes
On Fri, 19 Oct 2012, Glauber Costa wrote: > >>> Do we actually need to test PF_KTHREAD when current->mm == NULL? > >>> Perhaps because of aio threads whcih temporarily adopt a userspace mm? > >> > >> I believe so. I remember I discussed this in the past with David > >> Rientjes and he advised me

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-19 Thread Glauber Costa
On 10/19/2012 02:06 AM, David Rientjes wrote: > On Thu, 18 Oct 2012, Glauber Costa wrote: > >>> Do we actually need to test PF_KTHREAD when current->mm == NULL? >>> Perhaps because of aio threads whcih temporarily adopt a userspace mm? >> >> I believe so. I remember I discussed this in the past w

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-18 Thread David Rientjes
On Thu, 18 Oct 2012, Glauber Costa wrote: > > Do we actually need to test PF_KTHREAD when current->mm == NULL? > > Perhaps because of aio threads whcih temporarily adopt a userspace mm? > > I believe so. I remember I discussed this in the past with David > Rientjes and he advised me to test for

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-18 Thread David Rientjes
On Thu, 18 Oct 2012, Glauber Costa wrote: > >> @@ -2630,6 +2634,171 @@ static void __mem_cgroup_commit_charge(struct > >> mem_cgroup *memcg, > >>memcg_check_events(memcg, page); > >> } > >> > >> +#ifdef CONFIG_MEMCG_KMEM > >> +static inline bool memcg_can_account_kmem(struct mem_cgroup *me

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-18 Thread Glauber Costa
On 10/18/2012 02:37 AM, David Rientjes wrote: > On Tue, 16 Oct 2012, Glauber Costa wrote: > >> +/* If the test is dying, just let it go. */ >> +if (unlikely(test_thread_flag(TIF_MEMDIE) >> + || fatal_signal_pending(current))) >> +return true; > > This c

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-18 Thread Glauber Costa
On 10/18/2012 02:12 AM, Andrew Morton wrote: > On Tue, 16 Oct 2012 14:16:43 +0400 > Glauber Costa wrote: > >> This patch introduces infrastructure for tracking kernel memory pages to >> a given memcg. This will happen whenever the caller includes the flag >> __GFP_KMEMCG flag, and the task belong

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-17 Thread David Rientjes
On Tue, 16 Oct 2012, Glauber Costa wrote: > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 8d9489f..303a456 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -21,6 +21,7 @@ > #define _LINUX_MEMCONTROL_H > #include > #include > +#in

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-17 Thread Andrew Morton
On Tue, 16 Oct 2012 14:16:43 +0400 Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-16 Thread Kamezawa Hiroyuki
(2012/10/16 19:16), Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h those functions a