mm: memcg: do not allow task about to OOM kill to bypass the limit

Commit 4942642080 ("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 <[email protected]>
Reported-by: David Rientjes <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-bt: David Rientjes <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Johannes Weiner authored and Linus Torvalds committed 2013-12-12 18:19:26 -08:00
1 parent 96f1c58d85
commit 1f14c1ac19
1 file changed
+1 -1
+1 -1
View File
@@ -2694,7 +2694,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;