diff options
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 864bba992735..d503e9ce1c7b 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -281,14 +281,9 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task, | |||
281 | if (oom_task_origin(task)) | 281 | if (oom_task_origin(task)) |
282 | return OOM_SCAN_SELECT; | 282 | return OOM_SCAN_SELECT; |
283 | 283 | ||
284 | if (task->flags & PF_EXITING && !force_kill) { | 284 | if (task_will_free_mem(task) && !force_kill) |
285 | /* | 285 | return OOM_SCAN_ABORT; |
286 | * If this task is not being ptraced on exit, then wait for it | 286 | |
287 | * to finish before killing some other task unnecessarily. | ||
288 | */ | ||
289 | if (!(task->group_leader->ptrace & PT_TRACE_EXIT)) | ||
290 | return OOM_SCAN_ABORT; | ||
291 | } | ||
292 | return OOM_SCAN_OK; | 287 | return OOM_SCAN_OK; |
293 | } | 288 | } |
294 | 289 | ||
@@ -443,7 +438,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
443 | * If the task is already exiting, don't alarm the sysadmin or kill | 438 | * If the task is already exiting, don't alarm the sysadmin or kill |
444 | * its children or threads, just set TIF_MEMDIE so it can die quickly | 439 | * its children or threads, just set TIF_MEMDIE so it can die quickly |
445 | */ | 440 | */ |
446 | if (p->flags & PF_EXITING) { | 441 | if (task_will_free_mem(p)) { |
447 | set_tsk_thread_flag(p, TIF_MEMDIE); | 442 | set_tsk_thread_flag(p, TIF_MEMDIE); |
448 | put_task_struct(p); | 443 | put_task_struct(p); |
449 | return; | 444 | return; |
@@ -649,7 +644,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | |||
649 | * select it. The goal is to allow it to allocate so that it may | 644 | * select it. The goal is to allow it to allocate so that it may |
650 | * quickly exit and free its memory. | 645 | * quickly exit and free its memory. |
651 | */ | 646 | */ |
652 | if (fatal_signal_pending(current) || current->flags & PF_EXITING) { | 647 | if (fatal_signal_pending(current) || task_will_free_mem(current)) { |
653 | set_thread_flag(TIF_MEMDIE); | 648 | set_thread_flag(TIF_MEMDIE); |
654 | return; | 649 | return; |
655 | } | 650 | } |