Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Thu 08-11-12 07:29:23, Tejun Heo wrote: > Hey, Michal. > > On Thu, Nov 08, 2012 at 04:20:39PM +0100, Michal Hocko wrote: > > > So, in the above example in CPU2, (B->state & FREEZING) test and > > > freezer_apply_state(C, false) can't be interleaved with the same > > > inheritance operation

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Tejun Heo
Hey, Michal. On Thu, Nov 08, 2012 at 04:20:39PM +0100, Michal Hocko wrote: > > So, in the above example in CPU2, (B->state & FREEZING) test and > > freezer_apply_state(C, false) can't be interleaved with the same > > inheritance operation from CPU1. They either happen before or after. > > I am

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Thu 08-11-12 06:18:48, Tejun Heo wrote: > Hello, Michal. > > On Thu, Nov 08, 2012 at 03:08:52PM +0100, Michal Hocko wrote: > > This seems to be racy because parent->state access is not linearized. > > Say we have parallel freeze and thawing on a tree like the following: > > A > > | > >

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Tejun Heo
Hello, Michal. On Thu, Nov 08, 2012 at 03:08:52PM +0100, Michal Hocko wrote: > This seems to be racy because parent->state access is not linearized. > Say we have parallel freeze and thawing on a tree like the following: > A > | > B > | > C > > pre_order will

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Wed 07-11-12 08:39:19, Tejun Heo wrote: [...] > --- a/kernel/cgroup_freezer.c > +++ b/kernel/cgroup_freezer.c [...] > @@ -320,14 +388,39 @@ static void freezer_apply_state(struct f > * @freezer: freezer of interest > * @freeze: whether to freeze or thaw > * > - * Freeze or thaw @cgroup

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Wed 07-11-12 08:39:19, Tejun Heo wrote: [...] --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c [...] @@ -320,14 +388,39 @@ static void freezer_apply_state(struct f * @freezer: freezer of interest * @freeze: whether to freeze or thaw * - * Freeze or thaw @cgroup according

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Tejun Heo
Hello, Michal. On Thu, Nov 08, 2012 at 03:08:52PM +0100, Michal Hocko wrote: This seems to be racy because parent-state access is not linearized. Say we have parallel freeze and thawing on a tree like the following: A | B | C pre_order will visit them

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Thu 08-11-12 06:18:48, Tejun Heo wrote: Hello, Michal. On Thu, Nov 08, 2012 at 03:08:52PM +0100, Michal Hocko wrote: This seems to be racy because parent-state access is not linearized. Say we have parallel freeze and thawing on a tree like the following: A | B

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Tejun Heo
Hey, Michal. On Thu, Nov 08, 2012 at 04:20:39PM +0100, Michal Hocko wrote: So, in the above example in CPU2, (B-state FREEZING) test and freezer_apply_state(C, false) can't be interleaved with the same inheritance operation from CPU1. They either happen before or after. I am not sure I

Re: [PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-08 Thread Michal Hocko
On Thu 08-11-12 07:29:23, Tejun Heo wrote: Hey, Michal. On Thu, Nov 08, 2012 at 04:20:39PM +0100, Michal Hocko wrote: So, in the above example in CPU2, (B-state FREEZING) test and freezer_apply_state(C, false) can't be interleaved with the same inheritance operation from CPU1. They

[PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-07 Thread Tejun Heo
Up until now, cgroup_freezer didn't implement hierarchy properly. cgroups could be arranged in hierarchy but it didn't make any difference in how each cgroup_freezer behaved. They all operated separately. This patch implements proper hierarchy support. If a cgroup is frozen, all its descendants

[PATCH 9/9 v2] cgroup_freezer: implement proper hierarchy support

2012-11-07 Thread Tejun Heo
Up until now, cgroup_freezer didn't implement hierarchy properly. cgroups could be arranged in hierarchy but it didn't make any difference in how each cgroup_freezer behaved. They all operated separately. This patch implements proper hierarchy support. If a cgroup is frozen, all its descendants