diff options
author | Tejun Heo <tj@kernel.org> | 2014-03-19 17:43:21 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-03-19 17:43:21 -0400 |
commit | 1b9aba49eab5e85b0d3de8ba630cda6d68546297 (patch) | |
tree | 189d5d24c13399c346e50e1d3be40dbc59ec98e4 /security | |
parent | 8cbbf2c972c4444cad36f61cd571714c39b8cf04 (diff) | |
download | linux-1b9aba49eab5e85b0d3de8ba630cda6d68546297.tar.gz linux-1b9aba49eab5e85b0d3de8ba630cda6d68546297.tar.bz2 linux-1b9aba49eab5e85b0d3de8ba630cda6d68546297.zip |
cgroup: fix cgroup_taskset walking order
cgroup_taskset is used to track and iterate target tasks while
migrating a task or process and should guarantee that the first task
iterated is the task group leader if a process is being migrated.
b3dc094e9390 ("cgroup: use css_set->mg_tasks to track target tasks
during migration") replaced flex array cgroup_taskset->tc_array with
css_set->mg_tasks list to remove process size limit and dynamic
allocation during migration; unfortunately, it incorrectly used list
operations which don't preserve order breaking the guarantee that
cgroup_taskset_first() returns the leader for a process target.
Fix it by using order preserving list operations. Note that as
multiple src_csets may map to a single dst_cset, the iteration order
may change across cgroup_task_migrate(); however, the leader is still
guaranteed to be the first entry.
The switch to list_splice_tail_init() at the end of cgroup_migrate()
isn't strictly necessary. Let's still do it for consistency.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions