proc: turn signal_struct->count into "int nr_threads"
authorOleg Nesterov <[email protected]>
Wed, 26 May 2010 21:43:24 +0000 (14:43 -0700)
committerLinus Torvalds <[email protected]>
Thu, 27 May 2010 16:12:47 +0000 (09:12 -0700)
commitb3ac022cb9dc5883505a88b159d1b240ad1ef405
treebffa035303cbe3c5bde048ac3d3154fb57059e2d
parentdd98acf74762764fbc4382a1d9a244f11a2658cc
proc: turn signal_struct->count into "int nr_threads"

No functional changes, just s/atomic_t count/int nr_threads/.

With the recent changes this counter has a single user, get_nr_threads()
And, none of its callers need the really accurate number of threads, not
to mention each caller obviously races with fork/exit.  It is only used to
report this value to the user-space, except first_tid() uses it to avoid
the unnecessary while_each_thread() loop in the unlikely case.

It is a bit sad we need a word in struct signal_struct for this, perhaps
we can change get_nr_threads() to approximate the number of threads using
signal->live and kill ->nr_threads later.

[[email protected]: coding-style fixes]
Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/init_task.h
include/linux/sched.h
kernel/exit.c
kernel/fork.c