diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-05-26 17:43:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:46 -0400 |
commit | d344193a05da89c97e965da2c5cbf687d7385eae (patch) | |
tree | 6267b68c31c4547f1749acd35d2a5bfaff919839 /kernel | |
parent | 09faef11df8c559a23e2405d123cb2683733a79a (diff) |
exit: avoid sig->count in de_thread/__exit_signal synchronization
de_thread() and __exit_signal() use signal_struct->count/notify_count for
synchronization. We can simplify the code and use ->notify_count only.
Instead of comparing these two counters, we can change de_thread() to set
->notify_count = nr_of_sub_threads, then change __exit_signal() to
dec-and-test this counter and notify group_exit_task.
Note that __exit_signal() checks "notify_count > 0" just for symmetry with
exit_notify(), we could just check it is != 0.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 59a104c673f7..9220967f4256 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -97,7 +97,7 @@ static void __exit_signal(struct task_struct *tsk) | |||
97 | * If there is any task waiting for the group exit | 97 | * If there is any task waiting for the group exit |
98 | * then notify it: | 98 | * then notify it: |
99 | */ | 99 | */ |
100 | if (sig->group_exit_task && atomic_read(&sig->count) == sig->notify_count) | 100 | if (sig->notify_count > 0 && !--sig->notify_count) |
101 | wake_up_process(sig->group_exit_task); | 101 | wake_up_process(sig->group_exit_task); |
102 | 102 | ||
103 | if (tsk == sig->curr_target) | 103 | if (tsk == sig->curr_target) |