]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/oom.h
mm, oom: fortify task_will_free_mem()
[mirror_ubuntu-artful-kernel.git] / include / linux / oom.h
index 606137b3b778e224291ba89e2df3d87277134aa8..5bc0457ee3a88955f64b750a06858d45cb74b5da 100644 (file)
@@ -73,9 +73,9 @@ static inline bool oom_task_origin(const struct task_struct *p)
 extern void mark_oom_victim(struct task_struct *tsk);
 
 #ifdef CONFIG_MMU
-extern void try_oom_reaper(struct task_struct *tsk);
+extern void wake_oom_reaper(struct task_struct *tsk);
 #else
-static inline void try_oom_reaper(struct task_struct *tsk)
+static inline void wake_oom_reaper(struct task_struct *tsk)
 {
 }
 #endif
@@ -107,27 +107,7 @@ extern void oom_killer_enable(void);
 
 extern struct task_struct *find_lock_task_mm(struct task_struct *p);
 
-static inline bool task_will_free_mem(struct task_struct *task)
-{
-       struct signal_struct *sig = task->signal;
-
-       /*
-        * A coredumping process may sleep for an extended period in exit_mm(),
-        * so the oom killer cannot assume that the process will promptly exit
-        * and release memory.
-        */
-       if (sig->flags & SIGNAL_GROUP_COREDUMP)
-               return false;
-
-       if (!(task->flags & PF_EXITING))
-               return false;
-
-       /* Make sure that the whole thread group is going down */
-       if (!thread_group_empty(task) && !(sig->flags & SIGNAL_GROUP_EXIT))
-               return false;
-
-       return true;
-}
+bool task_will_free_mem(struct task_struct *task);
 
 /* sysctls */
 extern int sysctl_oom_dump_tasks;