+ per-task-delay-accounting-taskstats-interface-fix-2.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Send statistics even if thread group leader exits

has been added to the -mm tree.  Its filename is

     per-task-delay-accounting-taskstats-interface-fix-2.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Send statistics even if thread group leader exits
From: Balbir Singh <balbir@xxxxxxxxxx>


The following problem was found during the usage of the per-task delay
accounting code.

When a thread group leader exits, the statistics of the remaining threads
in the thread group are not sent on exit.  delayacct_add_tsk() would fail
for the thread group leader.  This fix causes statistics collected for the
pid to be sent out, even if collection of tgid statistics fail.

Test Program Psuedocode

1. Main program
	creates two threads called t1 and t2
	calls pthread_exit()

2. t1
	sleeps for a while
	calls pthread_exit()
3. t2
	sleeps for a while
	calls pthread_exit()

Earlier no stats were being sent for t1 and t2.

The pid statistics are being sent to user space after the fix.

Signed-off-by: Balbir Singh <balbir@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 kernel/taskstats.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -puN kernel/taskstats.c~per-task-delay-accounting-taskstats-interface-fix-2 kernel/taskstats.c
--- 25/kernel/taskstats.c~per-task-delay-accounting-taskstats-interface-fix-2	Fri Jun  2 14:32:49 2006
+++ 25-akpm/kernel/taskstats.c	Fri Jun  2 14:32:49 2006
@@ -267,8 +267,15 @@ void taskstats_exit_send(struct task_str
 	}
 
 	rc = fill_tgid(tsk->pid, tsk, tgidstats);
-	if (rc < 0)
-		goto err_skb;
+	/*
+	 * If fill_tgid() failed then one probable reason could be that the
+	 * thread group leader has exited. fill_tgid() will fail, send out
+	 * the pid statistics collected earlier.
+	 */
+	if (rc < 0) {
+		send_reply(rep_skb, 0, TASKSTATS_MSG_MULTICAST);
+		goto ret;
+	}
 
 	na = nla_nest_start(rep_skb, TASKSTATS_TYPE_AGGR_TGID);
 	NLA_PUT_U32(rep_skb, TASKSTATS_TYPE_TGID, (u32)tsk->tgid);
_

Patches currently in -mm which might be from balbir@xxxxxxxxxx are

fix-dcache-race-during-umount.patch
prune_one_dentry-tweaks.patch
per-task-delay-accounting-setup.patch
per-task-delay-accounting-setup-fix-1.patch
per-task-delay-accounting-setup-fix-2.patch
per-task-delay-accounting-sync-block-i-o-and-swapin-delay-collection.patch
per-task-delay-accounting-sync-block-i-o-and-swapin-delay-collection-fix-1.patch
per-task-delay-accounting-cpu-delay-collection-via-schedstats.patch
per-task-delay-accounting-cpu-delay-collection-via-schedstats-fix-1.patch
per-task-delay-accounting-utilities-for-genetlink-usage.patch
per-task-delay-accounting-taskstats-interface.patch
per-task-delay-accounting-taskstats-interface-fix-1.patch
per-task-delay-accounting-taskstats-interface-fix-2.patch
per-task-delay-accounting-delay-accounting-usage-of-taskstats-interface.patch
per-task-delay-accounting-delay-accounting-usage-of-taskstats-interface-use-portable-cputime-api-in-__delayacct_add_tsk.patch
per-task-delay-accounting-documentation.patch
per-task-delay-accounting-proc-export-of-aggregated-block-i-o-delays.patch
per-task-delay-accounting-proc-export-of-aggregated-block-i-o-delays-warning-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux