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
commitc59cd3d840b1b0a8f996cbbd9132128dcaabbeb9 (patch)
treef2ad31b11b14c00cfaa5327a5a587fae56604866 /mm
parent0942eeeef68f9493c1bcb1a52baf612b73fcf9fb (diff)
cgroup: make cgroup_task_iter remember the cgroup being iterated
Currently all cgroup_task_iter functions require @cgrp to be passed in, which is superflous and increases chance of usage error. Make cgroup_task_iter remember the cgroup being iterated and drop @cgrp argument from next and end functions. 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: Matt Helsley <matthltc@us.ibm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 00b055dd1d3d..5a5f4dc649f0 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1804,7 +1804,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1804 struct task_struct *task; 1804 struct task_struct *task;
1805 1805
1806 cgroup_task_iter_start(cgroup, &it); 1806 cgroup_task_iter_start(cgroup, &it);
1807 while ((task = cgroup_task_iter_next(cgroup, &it))) { 1807 while ((task = cgroup_task_iter_next(&it))) {
1808 switch (oom_scan_process_thread(task, totalpages, NULL, 1808 switch (oom_scan_process_thread(task, totalpages, NULL,
1809 false)) { 1809 false)) {
1810 case OOM_SCAN_SELECT: 1810 case OOM_SCAN_SELECT:
@@ -1817,7 +1817,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1817 case OOM_SCAN_CONTINUE: 1817 case OOM_SCAN_CONTINUE:
1818 continue; 1818 continue;
1819 case OOM_SCAN_ABORT: 1819 case OOM_SCAN_ABORT:
1820 cgroup_task_iter_end(cgroup, &it); 1820 cgroup_task_iter_end(&it);
1821 mem_cgroup_iter_break(memcg, iter); 1821 mem_cgroup_iter_break(memcg, iter);
1822 if (chosen) 1822 if (chosen)
1823 put_task_struct(chosen); 1823 put_task_struct(chosen);
@@ -1834,7 +1834,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1834 get_task_struct(chosen); 1834 get_task_struct(chosen);
1835 } 1835 }
1836 } 1836 }
1837 cgroup_task_iter_end(cgroup, &it); 1837 cgroup_task_iter_end(&it);
1838 } 1838 }
1839 1839
1840 if (!chosen) 1840 if (!chosen)