diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 04:47:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:39 -0400 |
commit | c5f1cc8c1828486a61ab3e575da6e2c62b34d399 (patch) | |
tree | 9cc88e7d1dae063482e1e9117ded747578cbd7ad /kernel/exit.c | |
parent | 8cd9c249128a59e8e833d454a784b0cbd338d468 (diff) |
coredump: turn core_state->nr_threads into atomic_t
Turn core_state->nr_threads into atomic_t and kill now unneeded
down_write(&mm->mmap_sem) in exit_mm().
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 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 988e232254e9..63d82957baae 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -678,10 +678,9 @@ static void exit_mm(struct task_struct * tsk) | |||
678 | down_read(&mm->mmap_sem); | 678 | down_read(&mm->mmap_sem); |
679 | if (mm->core_state) { | 679 | if (mm->core_state) { |
680 | up_read(&mm->mmap_sem); | 680 | up_read(&mm->mmap_sem); |
681 | down_write(&mm->mmap_sem); | 681 | |
682 | if (!--mm->core_state->nr_threads) | 682 | if (atomic_dec_and_test(&mm->core_state->nr_threads)) |
683 | complete(&mm->core_state->startup); | 683 | complete(&mm->core_state->startup); |
684 | up_write(&mm->mmap_sem); | ||
685 | 684 | ||
686 | wait_for_completion(&mm->core_done); | 685 | wait_for_completion(&mm->core_done); |
687 | down_read(&mm->mmap_sem); | 686 | down_read(&mm->mmap_sem); |