mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[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>
This commit is contained in:
parent
7407251a0e
commit
2384f55f8a
1 changed files with 5 additions and 8 deletions
13
fs/exec.c
13
fs/exec.c
|
@ -1417,19 +1417,16 @@ static void zap_threads (struct mm_struct *mm)
|
||||||
static void coredump_wait(struct mm_struct *mm)
|
static void coredump_wait(struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
DECLARE_COMPLETION(startup_done);
|
DECLARE_COMPLETION(startup_done);
|
||||||
|
int core_waiters;
|
||||||
|
|
||||||
mm->core_waiters++; /* let other threads block */
|
|
||||||
mm->core_startup_done = &startup_done;
|
mm->core_startup_done = &startup_done;
|
||||||
|
|
||||||
/* give other threads a chance to run: */
|
|
||||||
yield();
|
|
||||||
|
|
||||||
zap_threads(mm);
|
zap_threads(mm);
|
||||||
if (--mm->core_waiters) {
|
core_waiters = mm->core_waiters;
|
||||||
up_write(&mm->mmap_sem);
|
up_write(&mm->mmap_sem);
|
||||||
|
|
||||||
|
if (core_waiters)
|
||||||
wait_for_completion(&startup_done);
|
wait_for_completion(&startup_done);
|
||||||
} else
|
|
||||||
up_write(&mm->mmap_sem);
|
|
||||||
BUG_ON(mm->core_waiters);
|
BUG_ON(mm->core_waiters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue