diff options
author | Tejun Heo <tj@kernel.org> | 2012-10-17 00:03:14 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-10-21 01:28:56 +0200 |
commit | 8755ade683241e8c6b8fe8d22d0ae35041a3dc51 (patch) | |
tree | 34b0aaa3f6575d7edaf11cf18142399eaab70374 /lib/memweight.c | |
parent | cgroup_freezer: don't stall transition to FROZEN for PF_NOFREEZE or PF_FREEZE... (diff) | |
download | linux-8755ade683241e8c6b8fe8d22d0ae35041a3dc51.tar.xz linux-8755ade683241e8c6b8fe8d22d0ae35041a3dc51.zip |
cgroup_freezer: allow moving tasks in and out of a frozen cgroup
cgroup_freezer is one of the few users of cgroup_subsys->can_attach()
and uses it to prevent tasks from being migrated into or out of a
frozen cgroup. This makes cgroup_freezer cumbersome to use especially
when co-mounted with other controllers.
->can_attach() is problematic in general as it can make co-mounting
multiple cgroups difficult - migrating tasks may fail for reasons
completely irrelevant for other controllers. freezer_can_attach() in
particular is more problematic because it messes with cgroup internal
locking to ensure that the state verification performed at
freezer_can_attach() stays valid until migration is complete.
This patch replaces freezer_can_attach() with freezer_attach() so that
tasks are always allowed to migrate - they are nudged into the
conforming state from freezer_attach(). This means that there can be
tasks which are being migrated which don't conform to the current
cgroup_freezer state until freezer_attach() is complete. Under the
current locking scheme, the only such place is freezer_fork() which is
updated to handle such window.
While this patch doesn't remove the use of internal cgroup locking
from freezer_read/write() paths, it removes the requirement to keep
the freezer state constant while migrating and enables such change.
Note that this creates a userland visible behavior change - FROZEN
cgroup can no longer be used to lock migrations in and out of the
cgroup. This behavior change is intended. I don't think the feature
is necessary - userland should coordinate accesses to cgroup fs anyway
- and even if the feature is needed cgroup_freezer is the completely
wrong place to implement it.
Signed-off-by: Tejun Heo <tj@kernel.org>
LKML-Reference: <1350426526-14254-1-git-send-email-tj@kernel.org>
Cc: Matt Helsley <matthltc@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'lib/memweight.c')
0 files changed, 0 insertions, 0 deletions