summaryrefslogtreecommitdiff
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-08-06 16:05:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 18:01:17 -0700
commit28c34c291e746aab1c2bfd6d6609b2e47fa0978b (patch)
tree8c9c3c2264e4a63043c7849c6991d4f7927a6096 /mm/memcontrol.c
parent06b078fc065fe1fe7097675c8ee416aa2ef94fb3 (diff)
downloadlwn-28c34c291e746aab1c2bfd6d6609b2e47fa0978b.tar.gz
lwn-28c34c291e746aab1c2bfd6d6609b2e47fa0978b.zip
mm: memcontrol: reclaim at least once for __GFP_NORETRY
Currently, __GFP_NORETRY tries charging once and gives up before even trying to reclaim. Bring the behavior on par with the page allocator and reclaim at least once before giving up. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Tejun Heo <tj@kernel.org> Cc: Vladimir Davydov <vdavydov@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f7b6bec9f538..a73f3947f5d9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2613,13 +2613,13 @@ retry:
if (!(gfp_mask & __GFP_WAIT))
goto nomem;
- if (gfp_mask & __GFP_NORETRY)
- goto nomem;
-
nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags);
if (mem_cgroup_margin(mem_over_limit) >= batch)
goto retry;
+
+ if (gfp_mask & __GFP_NORETRY)
+ goto nomem;
/*
* Even though the limit is exceeded at this point, reclaim
* may have been able to free some pages. Retry the charge