aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2005-10-30 18:02:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:23 -0500
commit2384f55f8aa520172c995965bd2f8a9740d53095 (patch)
tree3f2f746529a760824d87f790418bacb94cc5a247 /fs/exec.c
parent7407251a0e2ed099e4b12b742b635503e981507c (diff)
[PATCH] coredump_wait() cleanup
This patch deletes pointless code from coredump_wait(). 1. It does useless mm->core_waiters inc/dec under mm->mmap_sem, but any changes to ->core_waiters have no effect until we drop ->mmap_sem. 2. It calls yield() for absolutely unknown reason. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/exec.c b/fs/exec.c
index fc02dadc604a..6d9521636aaa 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1417,19 +1417,16 @@ static void zap_threads (struct mm_struct *mm)
1417static void coredump_wait(struct mm_struct *mm) 1417static void coredump_wait(struct mm_struct *mm)
1418{ 1418{
1419 DECLARE_COMPLETION(startup_done); 1419 DECLARE_COMPLETION(startup_done);
1420 int core_waiters;
1420 1421
1421 mm->core_waiters++; /* let other threads block */
1422 mm->core_startup_done = &startup_done; 1422 mm->core_startup_done = &startup_done;
1423 1423
1424 /* give other threads a chance to run: */
1425 yield();
1426
1427 zap_threads(mm); 1424 zap_threads(mm);
1428 if (--mm->core_waiters) { 1425 core_waiters = mm->core_waiters;
1429 up_write(&mm->mmap_sem); 1426 up_write(&mm->mmap_sem);
1427
1428 if (core_waiters)
1430 wait_for_completion(&startup_done); 1429 wait_for_completion(&startup_done);
1431 } else
1432 up_write(&mm->mmap_sem);
1433 BUG_ON(mm->core_waiters); 1430 BUG_ON(mm->core_waiters);
1434} 1431}
1435 1432