diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2013-12-12 17:12:35 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 07:48:57 -0800 |
commit | e9710e26511bd44af8f797dc773d3d81b0933a49 (patch) | |
tree | a6ee48f906fbe53073917159355958a8dc6038d8 | |
parent | 3594bd7a05cb04a2459f4fadf0dc8f6685f2e952 (diff) |
mm: memcg: do not allow task about to OOM kill to bypass the limit
commit 1f14c1ac19aa45118054b6d5425873c5c7fc23a1 upstream.
Commit 4942642080ea ("mm: memcg: handle non-error OOM situations more
gracefully") allowed tasks that already entered a memcg OOM condition to
bypass the memcg limit on subsequent allocation attempts hoping this
would expedite finishing the page fault and executing the kill.
David Rientjes is worried that this breaks memcg isolation guarantees
and since there is no evidence that the bypass actually speeds up fault
processing just change it so that these subsequent charge attempts fail
outright. The notable exception being __GFP_NOFAIL charges which are
required to bypass the limit regardless.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-bt: David Rientjes <rientjes@google.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | mm/memcontrol.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index cc4f9cbe760..b6e0722e813 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2675,7 +2675,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, goto bypass; if (unlikely(task_in_memcg_oom(current))) - goto bypass; + goto nomem; if (gfp_mask & __GFP_NOFAIL) oom = false; |