Commit 2384f55f authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

[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

2. It calls yield() for absolutely unknown reason.
Signed-off-by: default avatarOleg Nesterov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 7407251a
...@@ -1417,19 +1417,16 @@ static void zap_threads (struct mm_struct *mm) ...@@ -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)
{ {
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: */
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
BUG_ON(mm->core_waiters); BUG_ON(mm->core_waiters);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment