aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/oom.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/oom.h')
-rw-r--r--include/linux/oom.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h
index e8d6e1058723..853698c721f7 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -92,6 +92,17 @@ static inline bool oom_gfp_allowed(gfp_t gfp_mask)
92 92
93extern struct task_struct *find_lock_task_mm(struct task_struct *p); 93extern struct task_struct *find_lock_task_mm(struct task_struct *p);
94 94
95static inline bool task_will_free_mem(struct task_struct *task)
96{
97 /*
98 * A coredumping process may sleep for an extended period in exit_mm(),
99 * so the oom killer cannot assume that the process will promptly exit
100 * and release memory.
101 */
102 return (task->flags & PF_EXITING) &&
103 !(task->signal->flags & SIGNAL_GROUP_COREDUMP);
104}
105
95/* sysctls */ 106/* sysctls */
96extern int sysctl_oom_dump_tasks; 107extern int sysctl_oom_dump_tasks;
97extern int sysctl_oom_kill_allocating_task; 108extern int sysctl_oom_kill_allocating_task;