Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 16:37:53, Li Zefan wrote: > >>> But memcg_update_cache_sizes calls memcg_kmem_clear_activated on the > >>> error path. > >>> > >> > >> But memcg_kmem_mark_dead() checks the ACCOUNT flag not the ACCOUNTED flag. > >> Am I missing something? > >> > > > > Dang. You are right! Glauber,

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Li Zefan
>>> But memcg_update_cache_sizes calls memcg_kmem_clear_activated on the >>> error path. >>> >> >> But memcg_kmem_mark_dead() checks the ACCOUNT flag not the ACCOUNTED flag. >> Am I missing something? >> > > Dang. You are right! Glauber, is there any reason why > memcg_kmem_mark_dead checks only

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Glauber Costa
On 04/03/2013 12:18 PM, Michal Hocko wrote: > Dang. You are right! Glauber, is there any reason why > memcg_kmem_mark_dead checks only KMEM_ACCOUNTED_ACTIVE rather than > KMEM_ACCOUNTED_MASK? > > This all is very confusing to say the least. Yes, it is. In kmemcg we need to differentiate between

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 15:49:06, Li Zefan wrote: > On 2013/4/3 15:43, Michal Hocko wrote: > > On Wed 03-04-13 11:49:29, Li Zefan wrote: > Yes, indeed you are very right - and thanks for looking at such depth. > >>> > >>> So what about the patch bellow? It seems that I provoked all this mess > >>>

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Glauber Costa
On 04/02/2013 07:04 PM, Michal Hocko wrote: > On Tue 02-04-13 18:33:30, Glauber Costa wrote: >> On 04/02/2013 06:28 PM, Michal Hocko wrote: >>> On Tue 02-04-13 18:20:56, Glauber Costa wrote: On 04/02/2013 06:16 PM, Michal Hocko wrote: > mem_cgroup_css_online > memcg_init_kmem

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Li Zefan
On 2013/4/3 15:43, Michal Hocko wrote: > On Wed 03-04-13 11:49:29, Li Zefan wrote: Yes, indeed you are very right - and thanks for looking at such depth. >>> >>> So what about the patch bellow? It seems that I provoked all this mess >>> but my brain managed to push it away so I do not

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 11:49:29, Li Zefan wrote: > >> Yes, indeed you are very right - and thanks for looking at such depth. > > > > So what about the patch bellow? It seems that I provoked all this mess > > but my brain managed to push it away so I do not remember why I thought > > the parent needs

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 11:49:29, Li Zefan wrote: Yes, indeed you are very right - and thanks for looking at such depth. So what about the patch bellow? It seems that I provoked all this mess but my brain managed to push it away so I do not remember why I thought the parent needs reference

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Li Zefan
On 2013/4/3 15:43, Michal Hocko wrote: On Wed 03-04-13 11:49:29, Li Zefan wrote: Yes, indeed you are very right - and thanks for looking at such depth. So what about the patch bellow? It seems that I provoked all this mess but my brain managed to push it away so I do not remember why I

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Glauber Costa
On 04/02/2013 07:04 PM, Michal Hocko wrote: On Tue 02-04-13 18:33:30, Glauber Costa wrote: On 04/02/2013 06:28 PM, Michal Hocko wrote: On Tue 02-04-13 18:20:56, Glauber Costa wrote: On 04/02/2013 06:16 PM, Michal Hocko wrote: mem_cgroup_css_online memcg_init_kmem

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 15:49:06, Li Zefan wrote: On 2013/4/3 15:43, Michal Hocko wrote: On Wed 03-04-13 11:49:29, Li Zefan wrote: Yes, indeed you are very right - and thanks for looking at such depth. So what about the patch bellow? It seems that I provoked all this mess but my brain managed

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Glauber Costa
On 04/03/2013 12:18 PM, Michal Hocko wrote: Dang. You are right! Glauber, is there any reason why memcg_kmem_mark_dead checks only KMEM_ACCOUNTED_ACTIVE rather than KMEM_ACCOUNTED_MASK? This all is very confusing to say the least. Yes, it is. In kmemcg we need to differentiate between

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Li Zefan
But memcg_update_cache_sizes calls memcg_kmem_clear_activated on the error path. But memcg_kmem_mark_dead() checks the ACCOUNT flag not the ACCOUNTED flag. Am I missing something? Dang. You are right! Glauber, is there any reason why memcg_kmem_mark_dead checks only

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-03 Thread Michal Hocko
On Wed 03-04-13 16:37:53, Li Zefan wrote: But memcg_update_cache_sizes calls memcg_kmem_clear_activated on the error path. But memcg_kmem_mark_dead() checks the ACCOUNT flag not the ACCOUNTED flag. Am I missing something? Dang. You are right! Glauber, is there any reason why

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-02 Thread Li Zefan
>> Yes, indeed you are very right - and thanks for looking at such depth. > > So what about the patch bellow? It seems that I provoked all this mess > but my brain managed to push it away so I do not remember why I thought > the parent needs reference drop... It is "only" 3.9 thing fortunately. >

[PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-02 Thread Michal Hocko
On Tue 02-04-13 18:33:30, Glauber Costa wrote: > On 04/02/2013 06:28 PM, Michal Hocko wrote: > > On Tue 02-04-13 18:20:56, Glauber Costa wrote: > >> On 04/02/2013 06:16 PM, Michal Hocko wrote: > >>> mem_cgroup_css_online > >>> memcg_init_kmem > >>> mem_cgroup_get# refcnt

[PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-02 Thread Michal Hocko
On Tue 02-04-13 18:33:30, Glauber Costa wrote: On 04/02/2013 06:28 PM, Michal Hocko wrote: On Tue 02-04-13 18:20:56, Glauber Costa wrote: On 04/02/2013 06:16 PM, Michal Hocko wrote: mem_cgroup_css_online memcg_init_kmem mem_cgroup_get# refcnt = 2

Re: [PATCH -v2] memcg: don't do cleanup manually if mem_cgroup_css_online() fails

2013-04-02 Thread Li Zefan
Yes, indeed you are very right - and thanks for looking at such depth. So what about the patch bellow? It seems that I provoked all this mess but my brain managed to push it away so I do not remember why I thought the parent needs reference drop... It is only 3.9 thing fortunately. --- From