aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorShailabh Nagar <nagar@watson.ibm.com>2006-07-14 03:24:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:57 -0400
commitad4ecbcba72855a2b5319b96e2a3a65ed1ca3bfd (patch)
treea2f5b98598948525de77ab594e4432f09a230388 /kernel/exit.c
parent25890454667b3295f67b3372352be90705f8667c (diff)
[PATCH] delay accounting taskstats interface send tgid once
Send per-tgid data only once during exit of a thread group instead of once with each member thread exit. Currently, when a thread exits, besides its per-tid data, the per-tgid data of its thread group is also sent out, if its thread group is non-empty. The per-tgid data sent consists of the sum of per-tid stats for all *remaining* threads of the thread group. This patch modifies this sending in two ways: - the per-tgid data is sent only when the last thread of a thread group exits. This cuts down heavily on the overhead of sending/receiving per-tgid data, especially when other exploiters of the taskstats interface aren't interested in per-tgid stats - the semantics of the per-tgid data sent are changed. Instead of being the sum of per-tid data for remaining threads, the value now sent is the true total accumalated statistics for all threads that are/were part of the thread group. The patch also addresses a minor issue where failure of one accounting subsystem to fill in the taskstats structure was causing the send of taskstats to not be sent at all. The patch has been tested for stability and run cerberus for over 4 hours on an SMP. [akpm@osdl.org: bugfixes] Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jay Lan <jlan@engr.sgi.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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 9852ed8c2988..67c1e9a4f812 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -845,7 +845,7 @@ static void exit_notify(struct task_struct *tsk)
845fastcall NORET_TYPE void do_exit(long code) 845fastcall NORET_TYPE void do_exit(long code)
846{ 846{
847 struct task_struct *tsk = current; 847 struct task_struct *tsk = current;
848 struct taskstats *tidstats, *tgidstats; 848 struct taskstats *tidstats;
849 int group_dead; 849 int group_dead;
850 850
851 profile_task_exit(tsk); 851 profile_task_exit(tsk);
@@ -884,7 +884,7 @@ fastcall NORET_TYPE void do_exit(long code)
884 current->comm, current->pid, 884 current->comm, current->pid,
885 preempt_count()); 885 preempt_count());
886 886
887 taskstats_exit_alloc(&tidstats, &tgidstats); 887 taskstats_exit_alloc(&tidstats);
888 888
889 acct_update_integrals(tsk); 889 acct_update_integrals(tsk);
890 if (tsk->mm) { 890 if (tsk->mm) {
@@ -905,8 +905,8 @@ fastcall NORET_TYPE void do_exit(long code)
905#endif 905#endif
906 if (unlikely(tsk->audit_context)) 906 if (unlikely(tsk->audit_context))
907 audit_free(tsk); 907 audit_free(tsk);
908 taskstats_exit_send(tsk, tidstats, tgidstats); 908 taskstats_exit_send(tsk, tidstats, group_dead);
909 taskstats_exit_free(tidstats, tgidstats); 909 taskstats_exit_free(tidstats);
910 delayacct_tsk_exit(tsk); 910 delayacct_tsk_exit(tsk);
911 911
912 exit_mm(tsk); 912 exit_mm(tsk);