diff options
author | David Rientjes <rientjes@google.com> | 2017-01-24 18:18:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-24 19:26:14 -0500 |
commit | 3674534b775354516e5c148ea48f51d4d1909a78 (patch) | |
tree | a431455c63916046fe5a76b34c0988c3240be937 | |
parent | 3ba4bceef23206349d4130ddf140819b365de7c8 (diff) |
mm, memcg: do not retry precharge charges
When memory.move_charge_at_immigrate is enabled and precharges are
depleted during move, mem_cgroup_move_charge_pte_range() will attempt to
increase the size of the precharge.
Prevent precharges from ever looping by setting __GFP_NORETRY. This was
probably the intention of the GFP_KERNEL & ~__GFP_NORETRY, which is
pointless as written.
Fixes: 0029e19ebf84 ("mm: memcontrol: remove explicit OOM parameter in charge path")
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1701130208510.69402@chino.kir.corp.google.com
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/memcontrol.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a63a8f832664..b822e158b319 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4353,9 +4353,9 @@ static int mem_cgroup_do_precharge(unsigned long count) | |||
4353 | return ret; | 4353 | return ret; |
4354 | } | 4354 | } |
4355 | 4355 | ||
4356 | /* Try charges one by one with reclaim */ | 4356 | /* Try charges one by one with reclaim, but do not retry */ |
4357 | while (count--) { | 4357 | while (count--) { |
4358 | ret = try_charge(mc.to, GFP_KERNEL & ~__GFP_NORETRY, 1); | 4358 | ret = try_charge(mc.to, GFP_KERNEL | __GFP_NORETRY, 1); |
4359 | if (ret) | 4359 | if (ret) |
4360 | return ret; | 4360 | return ret; |
4361 | mc.precharge++; | 4361 | mc.precharge++; |