summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-08-06 16:08:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 18:01:22 -0700
commit61e02c745721a361ba238e70bfa1c84a4df1a4b7 (patch)
tree955aed6249a0dc68faa09bec44acbd68ffb5fbbe
parent618fde872163e782183ce574c77f1123e2be8887 (diff)
downloadlinux-61e02c745721a361ba238e70bfa1c84a4df1a4b7.tar.gz
linux-61e02c745721a361ba238e70bfa1c84a4df1a4b7.tar.bz2
linux-61e02c745721a361ba238e70bfa1c84a4df1a4b7.zip
mm: memcontrol: clean up reclaim size variable use in try_charge()
Charge reclaim and OOM currently use the charge batch variable, but batching is already disabled at that point. To simplify the charge logic, the batch variable is reset to the original request size when reclaim is entered, so it's functionally equal, but it's misleading. Switch reclaim/OOM to nr_pages, which is the original request size. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/memcontrol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a6a062e409eb..90dc501eaf3f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2612,7 +2612,7 @@ retry:
nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags);
- if (mem_cgroup_margin(mem_over_limit) >= batch)
+ if (mem_cgroup_margin(mem_over_limit) >= nr_pages)
goto retry;
if (gfp_mask & __GFP_NORETRY)
@@ -2626,7 +2626,7 @@ retry:
* unlikely to succeed so close to the limit, and we fall back
* to regular pages anyway in case of failure.
*/
- if (nr_reclaimed && batch <= (1 << PAGE_ALLOC_COSTLY_ORDER))
+ if (nr_reclaimed && nr_pages <= (1 << PAGE_ALLOC_COSTLY_ORDER))
goto retry;
/*
* At task move, charge accounts can be doubly counted. So, it's
@@ -2644,7 +2644,7 @@ retry:
if (fatal_signal_pending(current))
goto bypass;
- mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(batch));
+ mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(nr_pages));
nomem:
if (!(gfp_mask & __GFP_NOFAIL))
return -ENOMEM;