Skip to content

Commit 4822acb

Browse files
hfxspakpm00
authored andcommitted
mm, oom: do not check 0 mask in out_of_memory()
Since commit 60e2793 ("mm, oom: do not trigger out_of_memory from the #PF"), no user sets gfp_mask to 0. Remove the 0 mask check and update the comments. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Haifeng Xu <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Shakeel Butt <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 97de10a commit 4822acb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mm/oom_kill.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,10 @@ bool out_of_memory(struct oom_control *oc)
11301130

11311131
/*
11321132
* The OOM killer does not compensate for IO-less reclaim.
1133-
* pagefault_out_of_memory lost its gfp context so we have to
1134-
* make sure exclude 0 mask - all other users should have at least
1135-
* ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to
1136-
* invoke the OOM killer even if it is a GFP_NOFS allocation.
1133+
* But mem_cgroup_oom() has to invoke the OOM killer even
1134+
* if it is a GFP_NOFS allocation.
11371135
*/
1138-
if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
1136+
if (!(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
11391137
return true;
11401138

11411139
/*

0 commit comments

Comments
 (0)