[PATCHSET cgroup/for-3.8] cgroup_freezer: allow migration regardless of freezer state and update locking
tj at kernel.org
Tue Oct 16 22:28:39 UTC 2012
This patchset updates cgroup_freezer so that
* Unfreezable kernel tasks don't prevent a cgroup from transitioning
into FROZEN from FREEZING. There's nothing userland can do with or
about such tasks.
* Tasks can be moved in and out of a frozen cgroup. Tasks are made to
conform to the state of the new cgroup during migration. This
behavior makes a lot more sense and removes the use of
->can_attach() which makes co-mounting difficult.
* Remove use of cgroup_lock_live_group(). Grabbing cgroup_lock from
outside cgroup proper creates a painful locking dependency and is
being phased out. With the above behavior change, removing
dependency on cgroup_lock is pretty easy. IMHO, it was simply the
wrong behavior to implement which forced the wrong implementation.
This patchset contains the following seven patches.
0001 is a fix for a rather embarrassing bug in cgroup core. It does
things in the wrong order leaving a window for racing during fork.
0002 adds a missing mb() around freezing condition updates / checks.
0003-0004 make cgroup_freezer ignore unfreezable kernel tasks and
handle PF_FREEZER_SKIP correctly.
0005 allows migrating tasks in and out of a frozen cgroup.
0006-0007 remove the use of cgroup_lock_live_group().
This patchset is on top of v3.7-rc1 and available in the following git
include/linux/cgroup.h | 1
include/linux/freezer.h | 50 +++++++++--
kernel/cgroup.c | 62 ++++++--------
kernel/cgroup_freezer.c | 210 ++++++++++++++++--------------------------------
kernel/fork.c | 9 --
5 files changed, 147 insertions(+), 185 deletions(-)
More information about the Containers