aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorShakeel Butt <shakeelb@google.com>2021-04-29 22:56:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-30 11:20:37 -0700
commit3d0cbb9816935ea3846eb2c0d3c07cd31697267e (patch)
tree99c80ca5e871778b854cec485ffe1a6ada12bfd6 /mm/memcontrol.c
parentmemcg: cleanup root memcg checks (diff)
downloadlinux-dev-3d0cbb9816935ea3846eb2c0d3c07cd31697267e.tar.xz
linux-dev-3d0cbb9816935ea3846eb2c0d3c07cd31697267e.zip
memcg: enable memcg oom-kill for __GFP_NOFAIL
In the era of async memcg oom-killer, the commit a0d8b00a3381 ("mm: memcg: do not declare OOM from __GFP_NOFAIL allocations") added the code to skip memcg oom-killer for __GFP_NOFAIL allocations. The reason was that the __GFP_NOFAIL callers will not enter aync oom synchronization path and will keep the task marked as in memcg oom. At that time the tasks marked in memcg oom can bypass the memcg limits and the oom synchronization would have happened later in the later userspace triggered page fault. Thus letting the task marked as under memcg oom bypass the memcg limit for arbitrary time. With the synchronous memcg oom-killer (commit 29ef680ae7c21 ("memcg, oom: move out_of_memory back to the charge path")) and not letting the task marked under memcg oom to bypass the memcg limits (commit 1f14c1ac19aa4 ("mm: memcg: do not allow task about to OOM kill to bypass the limit")), we can again allow __GFP_NOFAIL allocations to trigger memcg oom-kill. This will make memcg oom behavior closer to page allocator oom behavior. Link: https://lkml.kernel.org/r/20210223204337.2785120-1-shakeelb@google.com Signed-off-by: Shakeel Butt <shakeelb@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: David Rientjes <rientjes@google.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.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c5ae6a878b8e..e01602134759 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2779,9 +2779,6 @@ retry:
if (gfp_mask & __GFP_RETRY_MAYFAIL)
goto nomem;
- if (gfp_mask & __GFP_NOFAIL)
- goto force;
-
if (fatal_signal_pending(current))
goto force;