aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-07-25 04:47:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:39 -0400
commit999d9fc1670bc082928b93b11d1f2e0e417d973c (patch)
treee540e7fd2fab970ba2be5e39ac9f8282a373bc24 /kernel/exit.c
parent32ecb1f26dd50eeaac4e3f4dea4541c97848e459 (diff)
coredump: move mm->core_waiters into struct core_state
Move mm->core_waiters into "struct core_state" allocated on stack. This shrinks mm_struct a little bit and allows further changes. This patch mostly does s/core_waiters/core_state. The only essential change is that coredump_wait() must clear mm->core_state before return. The coredump_wait()'s path is uglified and .text grows by 30 bytes, this is fixed by the next patch. 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index f7fa21dbced4..988e232254e9 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -670,16 +670,16 @@ static void exit_mm(struct task_struct * tsk)
670 return; 670 return;
671 /* 671 /*
672 * Serialize with any possible pending coredump. 672 * Serialize with any possible pending coredump.
673 * We must hold mmap_sem around checking core_waiters 673 * We must hold mmap_sem around checking core_state
674 * and clearing tsk->mm. The core-inducing thread 674 * and clearing tsk->mm. The core-inducing thread
675 * will increment core_waiters for each thread in the 675 * will increment ->nr_threads for each thread in the
676 * group with ->mm != NULL. 676 * group with ->mm != NULL.
677 */ 677 */
678 down_read(&mm->mmap_sem); 678 down_read(&mm->mmap_sem);
679 if (mm->core_waiters) { 679 if (mm->core_state) {
680 up_read(&mm->mmap_sem); 680 up_read(&mm->mmap_sem);
681 down_write(&mm->mmap_sem); 681 down_write(&mm->mmap_sem);
682 if (!--mm->core_waiters) 682 if (!--mm->core_state->nr_threads)
683 complete(&mm->core_state->startup); 683 complete(&mm->core_state->startup);
684 up_write(&mm->mmap_sem); 684 up_write(&mm->mmap_sem);
685 685