summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-07-25 12:47:46 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 21:53:40 +0400
commita94e2d408eaedbd85aae259621d46fafc10479a2 (patch)
treed853f7b2e183875c6ad90fb6ab38e084b037d043 /kernel
parent182c515fd2a942623aed4e4e0e0b37fe96571b05 (diff)
downloadlinux-a94e2d408eaedbd85aae259621d46fafc10479a2.tar.xz
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')
-rw-r--r--kernel/exit.c8
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)
if (atomic_dec_and_test(&core_state->nr_threads))
complete(&core_state->startup);
- wait_for_completion(&mm->core_done);
+ for (;;) {
+ set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+ if (!self.task) /* see coredump_finish() */
+ break;
+ schedule();
+ }
+ __set_task_state(tsk, TASK_RUNNING);
down_read(&mm->mmap_sem);
}
atomic_inc(&mm->mm_count);