aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/oom.h
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2015-01-26 15:58:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-26 16:37:18 -0500
commit9879de7373fcfb466ec198293b6ccc1ad7a42dd8 (patch)
tree047533253898e317ce7e41a1078433e1e19d625f /include/linux/oom.h
parent26bc420b59a38e4e6685a73345a0def461136dce (diff)
mm: page_alloc: embed OOM killing naturally into allocation slowpath
The OOM killing invocation does a lot of duplicative checks against the task's allocation context. Rework it to take advantage of the existing checks in the allocator slowpath. The OOM killer is invoked when the allocator is unable to reclaim any pages but the allocation has to keep looping. Instead of having a check for __GFP_NORETRY hidden in oom_gfp_allowed(), just move the OOM invocation to the true branch of should_alloc_retry(). The __GFP_FS check from oom_gfp_allowed() can then be moved into the OOM avoidance branch in __alloc_pages_may_oom(), along with the PF_DUMPCORE test. __alloc_pages_may_oom() can then signal to the caller whether the OOM killer was invoked, instead of requiring it to duplicate the order and high_zoneidx checks to guess this when deciding whether to continue. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: 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 'include/linux/oom.h')
-rw-r--r--include/linux/oom.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 853698c721f7..76200984d1e2 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -85,11 +85,6 @@ static inline void oom_killer_enable(void)
85 oom_killer_disabled = false; 85 oom_killer_disabled = false;
86} 86}
87 87
88static inline bool oom_gfp_allowed(gfp_t gfp_mask)
89{
90 return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY);
91}
92
93extern struct task_struct *find_lock_task_mm(struct task_struct *p); 88extern struct task_struct *find_lock_task_mm(struct task_struct *p);
94 89
95static inline bool task_will_free_mem(struct task_struct *task) 90static inline bool task_will_free_mem(struct task_struct *task)