Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-05 Thread Glauber Costa
On 04/04/2013 07:22 PM, Tejun Heo wrote: > On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: >>> But what harm does an additional reference do? >> >> No harm at all. I just wanted to be sure that this is not yet another >> "for memcg" hack. So if this is useful for other controllers

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-05 Thread Glauber Costa
On 04/04/2013 07:22 PM, Tejun Heo wrote: On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: But what harm does an additional reference do? No harm at all. I just wanted to be sure that this is not yet another for memcg hack. So if this is useful for other controllers then I have

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Kamezawa Hiroyuki
(2013/04/03 18:13), Li Zefan wrote: > Suppose we rmdir a cgroup and there're still css refs, this cgroup won't > be freed. Then we rmdir the parent cgroup, and the parent is freed due > to css ref draining to 0. Now it would be a disaster if the child cgroup > tries to access its parent. > > Make

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Wed 03-04-13 17:13:08, Li Zefan wrote: > Suppose we rmdir a cgroup and there're still css refs, this cgroup won't > be freed. Then we rmdir the parent cgroup, and the parent is freed due > to css ref draining to 0. Now it would be a disaster if the child cgroup > tries to access its parent. >

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Thu 04-04-13 08:22:13, Tejun Heo wrote: > On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: > > > But what harm does an additional reference do? > > > > No harm at all. I just wanted to be sure that this is not yet another > > "for memcg" hack. So if this is useful for other

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Tejun Heo
On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: > > But what harm does an additional reference do? > > No harm at all. I just wanted to be sure that this is not yet another > "for memcg" hack. So if this is useful for other controllers then I have > no objections of course. I think

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Thu 04-04-13 06:53:53, Tejun Heo wrote: > Hey, > > On Thu, Apr 04, 2013 at 01:37:50PM +0200, Michal Hocko wrote: > > On Wed 03-04-13 17:13:08, Li Zefan wrote: > > > Suppose we rmdir a cgroup and there're still css refs, this cgroup won't > > > be freed. Then we rmdir the parent cgroup, and the

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Tejun Heo
Hey, On Thu, Apr 04, 2013 at 01:37:50PM +0200, Michal Hocko wrote: > On Wed 03-04-13 17:13:08, Li Zefan wrote: > > Suppose we rmdir a cgroup and there're still css refs, this cgroup won't > > be freed. Then we rmdir the parent cgroup, and the parent is freed due > > to css ref draining to 0. Now

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Wed 03-04-13 17:13:08, Li Zefan wrote: > Suppose we rmdir a cgroup and there're still css refs, this cgroup won't > be freed. Then we rmdir the parent cgroup, and the parent is freed due > to css ref draining to 0. Now it would be a disaster if the child cgroup > tries to access its parent.

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Wed 03-04-13 17:13:08, Li Zefan wrote: Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it would be a disaster if the child cgroup tries to access its parent. Hmm, I

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Tejun Heo
Hey, On Thu, Apr 04, 2013 at 01:37:50PM +0200, Michal Hocko wrote: On Wed 03-04-13 17:13:08, Li Zefan wrote: Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Thu 04-04-13 06:53:53, Tejun Heo wrote: Hey, On Thu, Apr 04, 2013 at 01:37:50PM +0200, Michal Hocko wrote: On Wed 03-04-13 17:13:08, Li Zefan wrote: Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Tejun Heo
On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: But what harm does an additional reference do? No harm at all. I just wanted to be sure that this is not yet another for memcg hack. So if this is useful for other controllers then I have no objections of course. I think it

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Thu 04-04-13 08:22:13, Tejun Heo wrote: On Thu, Apr 04, 2013 at 05:20:28PM +0200, Michal Hocko wrote: But what harm does an additional reference do? No harm at all. I just wanted to be sure that this is not yet another for memcg hack. So if this is useful for other controllers then I

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Michal Hocko
On Wed 03-04-13 17:13:08, Li Zefan wrote: Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it would be a disaster if the child cgroup tries to access its parent. Make

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Kamezawa Hiroyuki
(2013/04/03 18:13), Li Zefan wrote: Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it would be a disaster if the child cgroup tries to access its parent. Make sure

[RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-03 Thread Li Zefan
Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it would be a disaster if the child cgroup tries to access its parent. Make sure this won't happen. Signed-off-by: Li

[RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-03 Thread Li Zefan
Suppose we rmdir a cgroup and there're still css refs, this cgroup won't be freed. Then we rmdir the parent cgroup, and the parent is freed due to css ref draining to 0. Now it would be a disaster if the child cgroup tries to access its parent. Make sure this won't happen. Signed-off-by: Li