aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-05 12:16:59 -0500
committerTejun Heo <tj@kernel.org>2012-11-05 12:16:59 -0500
commitb25ed609d0eecf077db607e88ea70bae83b6adb2 (patch)
treeba6d9f2b6d1f0a389acb5a52cd4498c0f5ee6060 /mm/memcontrol.c
parent1a90dd508b0b00e382fd61a46f55dc889ac21b39 (diff)
cgroup: remove CGRP_WAIT_ON_RMDIR, cgroup_exclude_rmdir() and cgroup_release_and_wakeup_rmdir()
CGRP_WAIT_ON_RMDIR is another kludge which was added to make cgroup destruction rollback somewhat working. cgroup_rmdir() used to drain CSS references and CGRP_WAIT_ON_RMDIR and the associated waitqueue and helpers were used to allow the task performing rmdir to wait for the next relevant event. Unfortunately, the wait is visible to controllers too and the mechanism got exposed to memcg by 887032670d ("cgroup avoid permanent sleep at rmdir"). Now that the draining and retries are gone, CGRP_WAIT_ON_RMDIR is unnecessary. Remove it and all the mechanisms supporting it. Note that memcontrol.c changes are essentially revert of 887032670d ("cgroup avoid permanent sleep at rmdir"). Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 37c356646544..930edfaa5187 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2681,13 +2681,6 @@ static int mem_cgroup_move_account(struct page *page,
2681 /* caller should have done css_get */ 2681 /* caller should have done css_get */
2682 pc->mem_cgroup = to; 2682 pc->mem_cgroup = to;
2683 mem_cgroup_charge_statistics(to, anon, nr_pages); 2683 mem_cgroup_charge_statistics(to, anon, nr_pages);
2684 /*
2685 * We charges against "to" which may not have any tasks. Then, "to"
2686 * can be under rmdir(). But in current implementation, caller of
2687 * this function is just force_empty() and move charge, so it's
2688 * guaranteed that "to" is never removed. So, we don't check rmdir
2689 * status here.
2690 */
2691 move_unlock_mem_cgroup(from, &flags); 2684 move_unlock_mem_cgroup(from, &flags);
2692 ret = 0; 2685 ret = 0;
2693unlock: 2686unlock:
@@ -2893,7 +2886,6 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *memcg,
2893 return; 2886 return;
2894 if (!memcg) 2887 if (!memcg)
2895 return; 2888 return;
2896 cgroup_exclude_rmdir(&memcg->css);
2897 2889
2898 __mem_cgroup_commit_charge(memcg, page, 1, ctype, true); 2890 __mem_cgroup_commit_charge(memcg, page, 1, ctype, true);
2899 /* 2891 /*
@@ -2907,12 +2899,6 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *memcg,
2907 swp_entry_t ent = {.val = page_private(page)}; 2899 swp_entry_t ent = {.val = page_private(page)};
2908 mem_cgroup_uncharge_swap(ent); 2900 mem_cgroup_uncharge_swap(ent);
2909 } 2901 }
2910 /*
2911 * At swapin, we may charge account against cgroup which has no tasks.
2912 * So, rmdir()->pre_destroy() can be called while we do this charge.
2913 * In that case, we need to call pre_destroy() again. check it here.
2914 */
2915 cgroup_release_and_wakeup_rmdir(&memcg->css);
2916} 2902}
2917 2903
2918void mem_cgroup_commit_charge_swapin(struct page *page, 2904void mem_cgroup_commit_charge_swapin(struct page *page,
@@ -3360,8 +3346,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg,
3360 3346
3361 if (!memcg) 3347 if (!memcg)
3362 return; 3348 return;
3363 /* blocks rmdir() */ 3349
3364 cgroup_exclude_rmdir(&memcg->css);
3365 if (!migration_ok) { 3350 if (!migration_ok) {
3366 used = oldpage; 3351 used = oldpage;
3367 unused = newpage; 3352 unused = newpage;
@@ -3395,13 +3380,6 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg,
3395 */ 3380 */
3396 if (anon) 3381 if (anon)
3397 mem_cgroup_uncharge_page(used); 3382 mem_cgroup_uncharge_page(used);
3398 /*
3399 * At migration, we may charge account against cgroup which has no
3400 * tasks.
3401 * So, rmdir()->pre_destroy() can be called while we do this charge.
3402 * In that case, we need to call pre_destroy() again. check it here.
3403 */
3404 cgroup_release_and_wakeup_rmdir(&memcg->css);
3405} 3383}
3406 3384
3407/* 3385/*