Skip to content

Commit

Permalink
[PATCH] coredump_wait() cleanup
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 31, 2005
1 parent 7407251 commit 2384f55
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,19 +1417,16 @@ static void zap_threads (struct mm_struct *mm)
static void coredump_wait(struct mm_struct *mm)
{
DECLARE_COMPLETION(startup_done);
int core_waiters;

mm->core_waiters++; /* let other threads block */
mm->core_startup_done = &startup_done;

/* give other threads a chance to run: */
yield();

zap_threads(mm);
if (--mm->core_waiters) {
up_write(&mm->mmap_sem);
core_waiters = mm->core_waiters;
up_write(&mm->mmap_sem);

if (core_waiters)
wait_for_completion(&startup_done);
} else
up_write(&mm->mmap_sem);
BUG_ON(mm->core_waiters);
}

Expand Down

0 comments on commit 2384f55

Please sign in to comment.