diff options
| author | Roland McGrath <roland@redhat.com> | 2004-10-25 04:18:37 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-25 04:18:37 -0700 |
| commit | dd8e157f46d3779c7d72ac44835e5845081bb11c (patch) | |
| tree | 0838e233c4d90146de0750e7d343211ad770ef5f /include/linux | |
| parent | af8b3bb25ac618287de88644ed4d97c535658b04 (diff) | |
[PATCH] acct: report single record for multithreaded process
This patch changes process accounting to write just one record for a
process with many NPTL threads, rather than one record for each thread. No
record is written until the last thread exits. The process's record shows
the cumulative time of all the threads that ever lived in that process
(thread group). This seems like the clearly right thing and I assume it is
what anyone using process accounting really would like to see.
There is a race condition between multiple threads exiting at the same time
to decide which one should write the accounting record. I couldn't think
of anything clever using existing bookkeeping that would get this right, so
I added another counter for this. (There may be some potential to clean up
existing places that figure out how many non-zombie threads are in the
group, now that this count is available.)
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 04c8d47e8654..c26111af4c62 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -267,6 +267,7 @@ struct sighand_struct { */ struct signal_struct { atomic_t count; + atomic_t live; /* current thread group signal load-balancing target: */ task_t *curr_target; |
