]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup, memcg, cpuset: implement cgroup_taskset_for_each_leader()
authorTejun Heo <tj@kernel.org>
Fri, 11 Sep 2015 19:00:19 +0000 (15:00 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 22 Sep 2015 16:46:53 +0000 (12:46 -0400)
commit847d2bc2ed39059696bfdf7c474099aa929d4650
tree0f6212afa2e7e0e4724c5f12644508f1a0baf138
parent3cf87c7fbfbee86554a1131dd71343d6da8f9f64
cgroup, memcg, cpuset: implement cgroup_taskset_for_each_leader()

It wasn't explicitly documented but, when a process is being migrated,
cpuset and memcg depend on cgroup_taskset_first() returning the
threadgroup leader; however, this approach is somewhat ghetto and
would no longer work for the planned multi-process migration.

This patch introduces explicit cgroup_taskset_for_each_leader() which
iterates over only the threadgroup leaders and replaces
cgroup_taskset_first() usages for accessing the leader with it.

This prepares both memcg and cpuset for multi-process migration.  This
patch also updates the documentation for cgroup_taskset_for_each() to
clarify the iteration rules and removes comments mentioning task
ordering in tasksets.

v2: A previous patch which added threadgroup leader test was dropped.
    Patch updated accordingly.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
include/linux/cgroup.h
kernel/cgroup.c
kernel/cpuset.c
mm/memcontrol.c