mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
mm, oom: do not check 0 mask in out_of_memory()
Since commit 60e2793d44
("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/20230508073538.1168-1-haifeng.xu@shopee.com
Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
97de10a993
commit
4822acb136
@ -1130,12 +1130,10 @@ bool out_of_memory(struct oom_control *oc)
|
||||
|
||||
/*
|
||||
* The OOM killer does not compensate for IO-less reclaim.
|
||||
* pagefault_out_of_memory lost its gfp context so we have to
|
||||
* make sure exclude 0 mask - all other users should have at least
|
||||
* ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to
|
||||
* invoke the OOM killer even if it is a GFP_NOFS allocation.
|
||||
* But mem_cgroup_oom() has to invoke the OOM killer even
|
||||
* if it is a GFP_NOFS allocation.
|
||||
*/
|
||||
if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
|
||||
if (!(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
|
||||
return true;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user