Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105939
b: refs/heads/master
c: c5f1cc8
h: refs/heads/master
i:
  105937: 537f798
  105935: 35f0841
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jul 25, 2008
1 parent c29c50a commit c2ea9cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8cd9c249128a59e8e833d454a784b0cbd338d468
refs/heads/master: c5f1cc8c1828486a61ab3e575da6e2c62b34d399
2 changes: 1 addition & 1 deletion trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ static inline int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
}
rcu_read_unlock();
done:
core_state->nr_threads = nr;
atomic_set(&core_state->nr_threads, nr);
return nr;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct vm_area_struct {
};

struct core_state {
int nr_threads;
atomic_t nr_threads;
struct completion startup;
};

Expand Down
5 changes: 2 additions & 3 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c2ea9cc

Please sign in to comment.