cgroup: reorganize css_task_iter
authorTejun Heo <tj@kernel.org>
Wed, 23 Apr 2014 15:13:15 +0000 (11:13 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 23 Apr 2014 15:13:15 +0000 (11:13 -0400)
commit0f0a2b4fa6210147131082999f1f16d7fb79abf8
treeb1528915143e2d106590f798384f446bca1e5d17
parent3b281afbc3a06cd69c54e6db1a04a8e73997723f
cgroup: reorganize css_task_iter

This patch reorganizes css_task_iter so that adding effective css
support is easier.

* s/->cset_link/->cset_pos/ and s/->task/->task_pos/ for consistency

* ->origin_css is used to determine whether the iteration reached the
  last css_set.  Replace it with explicit ->cset_head so that
  css_advance_task_iter() doesn't have to know the termination
  condition directly.

* css_task_iter_next() currently assumes that it's walking list of
  cgrp_cset_link and reaches into the current cset through the current
  link to determine the termination conditions for task walking.  As
  this won't always be true for effective css walking, add
  ->tasks_head and ->mg_tasks_head and use them to control task
  walking so that css_task_iter_next() doesn't have to know how
  css_sets are being walked.

This patch doesn't make any behavior changes.  The iteration logic
stays unchanged after the patch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
include/linux/cgroup.h
kernel/cgroup.c