diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 04:47:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:40 -0400 |
commit | a94e2d408eaedbd85aae259621d46fafc10479a2 (patch) | |
tree | d853f7b2e183875c6ad90fb6ab38e084b037d043 /kernel/exit.c | |
parent | 182c515fd2a942623aed4e4e0e0b37fe96571b05 (diff) |
coredump: kill mm->core_done
Now that we have core_state->dumper list we can use it to wake up the
sub-threads waiting for the coredump completion.
This uglifies the code and .text grows by 47 bytes, but otoh mm_struct
lessens by sizeof(struct completion). Also, with this change we can
decouple exit_mm() from the coredumping code.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index b66f0d55c791..8a4d4d12e294 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -691,7 +691,13 @@ static void exit_mm(struct task_struct * tsk) | |||
691 | if (atomic_dec_and_test(&core_state->nr_threads)) | 691 | if (atomic_dec_and_test(&core_state->nr_threads)) |
692 | complete(&core_state->startup); | 692 | complete(&core_state->startup); |
693 | 693 | ||
694 | wait_for_completion(&mm->core_done); | 694 | for (;;) { |
695 | set_task_state(tsk, TASK_UNINTERRUPTIBLE); | ||
696 | if (!self.task) /* see coredump_finish() */ | ||
697 | break; | ||
698 | schedule(); | ||
699 | } | ||
700 | __set_task_state(tsk, TASK_RUNNING); | ||
695 | down_read(&mm->mmap_sem); | 701 | down_read(&mm->mmap_sem); |
696 | } | 702 | } |
697 | atomic_inc(&mm->mm_count); | 703 | atomic_inc(&mm->mm_count); |