diff options
-rw-r--r-- | mm/oom_kill.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 46bf2ed5594..597ecac5731 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -562,11 +562,11 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, struct task_struct *p; /* - * If current has a pending SIGKILL, then automatically select it. The - * goal is to allow it to allocate so that it may quickly exit and free - * its memory. + * If current has a pending SIGKILL or is exiting, then automatically + * select it. The goal is to allow it to allocate so that it may + * quickly exit and free its memory. */ - if (fatal_signal_pending(current)) { + if (fatal_signal_pending(current) || current->flags & PF_EXITING) { set_thread_flag(TIF_MEMDIE); return; } |