diff options
Diffstat (limited to 'include/linux/oom.h')
-rw-r--r-- | include/linux/oom.h | 11 |
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 | ||
93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
94 | 94 | ||
95 | static 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 */ |
96 | extern int sysctl_oom_dump_tasks; | 107 | extern int sysctl_oom_dump_tasks; |
97 | extern int sysctl_oom_kill_allocating_task; | 108 | extern int sysctl_oom_kill_allocating_task; |