Tejun Heo 1b9aba49ea 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>
2014-03-19 17:43:21 -04:00
..
2014-01-25 08:55:09 +01:00
2013-11-13 12:09:34 +09:00
2014-01-14 14:54:00 -05:00
2014-01-23 16:37:02 -08:00
2013-11-26 12:12:26 +01:00
2013-12-04 14:09:46 +10:30
2013-12-18 19:04:50 -08:00
2014-01-30 16:56:54 -08:00
2013-09-11 15:58:27 -07:00
2013-04-29 13:55:38 -07:00