exit: avoid sig->count in de_thread/__exit_signal synchronization
authorOleg Nesterov <oleg@redhat.com>
Wed, 26 May 2010 21:43:11 +0000 (14:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 27 May 2010 16:12:46 +0000 (09:12 -0700)
commitd344193a05da89c97e965da2c5cbf687d7385eae
tree6267b68c31c4547f1749acd35d2a5bfaff919839
parent09faef11df8c559a23e2405d123cb2683733a79a
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>
fs/exec.c
kernel/exit.c