mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
coredump: turn core_state->nr_threads into atomic_t
Turn core_state->nr_threads into atomic_t and kill now unneeded down_write(&mm->mmap_sem) in exit_mm(). 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>
This commit is contained in:
parent
8cd9c24912
commit
c5f1cc8c18
3 changed files with 4 additions and 5 deletions
|
@ -678,10 +678,9 @@ static void exit_mm(struct task_struct * tsk)
|
|||
down_read(&mm->mmap_sem);
|
||||
if (mm->core_state) {
|
||||
up_read(&mm->mmap_sem);
|
||||
down_write(&mm->mmap_sem);
|
||||
if (!--mm->core_state->nr_threads)
|
||||
|
||||
if (atomic_dec_and_test(&mm->core_state->nr_threads))
|
||||
complete(&mm->core_state->startup);
|
||||
up_write(&mm->mmap_sem);
|
||||
|
||||
wait_for_completion(&mm->core_done);
|
||||
down_read(&mm->mmap_sem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue