aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
commit72ec7029937f0518eff21b8762743c31591684f5 (patch)
tree43743a5d9e6a36548a23d5ff34ffc4c4fede8aa1 /mm
parente535837b1dae17b5a2d76ea1bc22ac1a79354624 (diff)
cgroup: make task iterators deal with cgroup_subsys_state instead of cgroup
cgroup is in the process of converting to css (cgroup_subsys_state) from cgroup as the principal subsystem interface handle. This is mostly to prepare for the unified hierarchy support where css's will be created and destroyed dynamically but also helps cleaning up subsystem implementations as css is usually what they are interested in anyway. This patch converts task iterators to deal with css instead of cgroup. Note that under unified hierarchy, different sets of tasks will be considered belonging to a given cgroup depending on the subsystem in question and making the iterators deal with css instead cgroup provides them with enough information about the iteration. While at it, fix several function comment formats in cpuset.c. This patch doesn't introduce any behavior differences. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com> Cc: Matt Helsley <matthltc@us.ibm.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5a5f4dc649f0..95106a993777 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1799,12 +1799,11 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1799 check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL); 1799 check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL);
1800 totalpages = mem_cgroup_get_limit(memcg) >> PAGE_SHIFT ? : 1; 1800 totalpages = mem_cgroup_get_limit(memcg) >> PAGE_SHIFT ? : 1;
1801 for_each_mem_cgroup_tree(iter, memcg) { 1801 for_each_mem_cgroup_tree(iter, memcg) {
1802 struct cgroup *cgroup = iter->css.cgroup; 1802 struct css_task_iter it;
1803 struct cgroup_task_iter it;
1804 struct task_struct *task; 1803 struct task_struct *task;
1805 1804
1806 cgroup_task_iter_start(cgroup, &it); 1805 css_task_iter_start(&iter->css, &it);
1807 while ((task = cgroup_task_iter_next(&it))) { 1806 while ((task = css_task_iter_next(&it))) {
1808 switch (oom_scan_process_thread(task, totalpages, NULL, 1807 switch (oom_scan_process_thread(task, totalpages, NULL,
1809 false)) { 1808 false)) {
1810 case OOM_SCAN_SELECT: 1809 case OOM_SCAN_SELECT:
@@ -1817,7 +1816,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1817 case OOM_SCAN_CONTINUE: 1816 case OOM_SCAN_CONTINUE:
1818 continue; 1817 continue;
1819 case OOM_SCAN_ABORT: 1818 case OOM_SCAN_ABORT:
1820 cgroup_task_iter_end(&it); 1819 css_task_iter_end(&it);
1821 mem_cgroup_iter_break(memcg, iter); 1820 mem_cgroup_iter_break(memcg, iter);
1822 if (chosen) 1821 if (chosen)
1823 put_task_struct(chosen); 1822 put_task_struct(chosen);
@@ -1834,7 +1833,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1834 get_task_struct(chosen); 1833 get_task_struct(chosen);
1835 } 1834 }
1836 } 1835 }
1837 cgroup_task_iter_end(&it); 1836 css_task_iter_end(&it);
1838 } 1837 }
1839 1838
1840 if (!chosen) 1839 if (!chosen)