diff options
author | Shailabh Nagar <nagar@watson.ibm.com> | 2006-07-14 03:24:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-15 00:53:57 -0400 |
commit | f9fd8914c1acca0d98b69d831b128d5b52f03c51 (patch) | |
tree | 18c2506bb31e49a9e2c4a483d37b0394c815fe9d /kernel/exit.c | |
parent | c8924363da07aec213e5d359f23eeae1fff91951 (diff) |
[PATCH] per-task delay accounting taskstats interface: control exit data through cpumasks
On systems with a large number of cpus, with even a modest rate of tasks
exiting per cpu, the volume of taskstats data sent on thread exit can
overflow a userspace listener's buffers.
One approach to avoiding overflow is to allow listeners to get data for a
limited and specific set of cpus. By scaling the number of listeners
and/or the cpus they monitor, userspace can handle the statistical data
overload more gracefully.
In this patch, each listener registers to listen to a specific set of cpus
by specifying a cpumask. The interest is recorded per-cpu. When a task
exits on a cpu, its taskstats data is unicast to each listener interested
in that cpu.
Thanks to Andrew Morton for pointing out the various scalability and
general concerns of previous attempts and for suggesting this design.
[akpm@osdl.org: build fix]
Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com>
Signed-off-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 67c1e9a4f812..dba194a8d416 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -847,6 +847,7 @@ fastcall NORET_TYPE void do_exit(long code) | |||
847 | struct task_struct *tsk = current; | 847 | struct task_struct *tsk = current; |
848 | struct taskstats *tidstats; | 848 | struct taskstats *tidstats; |
849 | int group_dead; | 849 | int group_dead; |
850 | unsigned int mycpu; | ||
850 | 851 | ||
851 | profile_task_exit(tsk); | 852 | profile_task_exit(tsk); |
852 | 853 | ||
@@ -884,7 +885,7 @@ fastcall NORET_TYPE void do_exit(long code) | |||
884 | current->comm, current->pid, | 885 | current->comm, current->pid, |
885 | preempt_count()); | 886 | preempt_count()); |
886 | 887 | ||
887 | taskstats_exit_alloc(&tidstats); | 888 | taskstats_exit_alloc(&tidstats, &mycpu); |
888 | 889 | ||
889 | acct_update_integrals(tsk); | 890 | acct_update_integrals(tsk); |
890 | if (tsk->mm) { | 891 | if (tsk->mm) { |
@@ -905,7 +906,7 @@ fastcall NORET_TYPE void do_exit(long code) | |||
905 | #endif | 906 | #endif |
906 | if (unlikely(tsk->audit_context)) | 907 | if (unlikely(tsk->audit_context)) |
907 | audit_free(tsk); | 908 | audit_free(tsk); |
908 | taskstats_exit_send(tsk, tidstats, group_dead); | 909 | taskstats_exit_send(tsk, tidstats, group_dead, mycpu); |
909 | taskstats_exit_free(tidstats); | 910 | taskstats_exit_free(tidstats); |
910 | delayacct_tsk_exit(tsk); | 911 | delayacct_tsk_exit(tsk); |
911 | 912 | ||