Skip to content

Commit

Permalink
memcg: clean up force_empty_list() return value check
Browse files Browse the repository at this point in the history
After bf544fdc241da8 "memcg: move charges to root cgroup if
use_hierarchy=0 in mem_cgroup_move_hugetlb_parent()"
mem_cgroup_move_parent() returns only -EBUSY or -EINVAL.  So we can remove
the -ENOMEM and -EINTR checks.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Kamezawa Hiroyuki authored and Linus Torvalds committed Aug 1, 2012
1 parent 59b8e85 commit d845aa2
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
@@ -3653,8 +3653,6 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
pc = lookup_page_cgroup(page);

ret = mem_cgroup_move_parent(page, pc, memcg, GFP_KERNEL);
if (ret == -ENOMEM || ret == -EINTR)
break;

if (ret == -EBUSY || ret == -EINVAL) {
/* found lock contention or "pc" is obsolete. */
@@ -3711,9 +3709,6 @@ static int mem_cgroup_force_empty(struct mem_cgroup *memcg, bool free_all)
}
mem_cgroup_end_move(memcg);
memcg_oom_recover(memcg);
/* it seems parent cgroup doesn't have enough mem */
if (ret == -ENOMEM)
goto try_to_free;
cond_resched();
/* "ret" should also be checked to ensure all lists are empty. */
} while (res_counter_read_u64(&memcg->res, RES_USAGE) > 0 || ret);

0 comments on commit d845aa2

Please sign in to comment.