|
@@ -1787,11 +1787,11 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
|
|
struct task_struct *chosen = NULL;
|
|
struct task_struct *chosen = NULL;
|
|
|
|
|
|
/*
|
|
/*
|
|
- * 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);
|
|
set_thread_flag(TIF_MEMDIE);
|
|
return;
|
|
return;
|
|
}
|
|
}
|