diff options
author | David Rientjes <rientjes@google.com> | 2010-08-09 20:18:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:44:56 -0400 |
commit | 4358997ae38a1901498d128d6508119d9f318b36 (patch) | |
tree | 0c5a47808790e80a754b44aebe82c5c683811788 /mm/oom_kill.c | |
parent | 7b98c2e402eaa1f2beec18b1bde17f74948a19db (diff) |
oom: avoid sending exiting tasks a SIGKILL
It's unnecessary to SIGKILL a task that is already PF_EXITING and can
actually cause a NULL pointer dereference of the sighand if it has already
been detached. Instead, simply set TIF_MEMDIE so it has access to memory
reserves and can quickly exit as the comment implies.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 64cdacad83d9..0c7c18f78425 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -453,7 +453,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
453 | * its children or threads, just set TIF_MEMDIE so it can die quickly | 453 | * its children or threads, just set TIF_MEMDIE so it can die quickly |
454 | */ | 454 | */ |
455 | if (p->flags & PF_EXITING) { | 455 | if (p->flags & PF_EXITING) { |
456 | __oom_kill_task(p, 0); | 456 | set_tsk_thread_flag(p, TIF_MEMDIE); |
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
459 | 459 | ||