cpuset: pin down cpus and mems while a task is being attached
authorTejun Heo <tj@kernel.org>
Mon, 7 Jan 2013 16:51:07 +0000 (08:51 -0800)
committerTejun Heo <tj@kernel.org>
Mon, 7 Jan 2013 16:51:07 +0000 (08:51 -0800)
commit452477fa68c6d8ef80adebd05194c1c157ad9a53
tree28682f4307a4e4bc2180d18ccb71a262700699df
parent8d03394877ecdf87e1d694664c460747b8e05aa1
cpuset: pin down cpus and mems while a task is being attached

cpuset is scheduled to be decoupled from cgroup_lock which will make
configuration updates race with task migration.  Any config update
will be allowed to happen between ->can_attach() and ->attach().  If
such config update removes either all cpus or mems, by the time
->attach() is called, the condition verified by ->can_attach(), that
the cpuset is capable of hosting the tasks, is no longer true.

This patch adds cpuset->attach_in_progress which is incremented from
->can_attach() and decremented when the attach operation finishes
either successfully or not.  validate_change() treats cpusets w/
non-zero ->attach_in_progress like cpusets w/ tasks and refuses to
remove all cpus or mems from it.

This currently doesn't make any functional difference as everything is
protected by cgroup_mutex but enables decoupling the locking.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cpuset.c
This page took 0.025378 seconds and 5 git commands to generate.