[PATCH -mm] Fix return value of delayacct_add_tsk()

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

 



Hi, Andrew,

This patch is to be applied on top of 
per-task-delay-accounting-taskstats-interface-fix-2.patch

Currently fill_tgid() fails if any thread in a thread_group has a missing
delays structure. This behaviour is incorrect in the case when a thread group
leader exits before any of the other threads in the group. The leader continues
to be examined but has a null tsk->delays struct. The correct behaviour is to
skip threads with a null delays struct and continue accumulating delay
accounting statistics for the other threads.

The patch also adds an explicit check for delay accounting being on since
presence or absence of tsk->delays struct is no longer an equivalent check.


Signed-off-by: Balbir Singh <[email protected]>
Signed-off-by: Shailabh Nagar <[email protected]>

---

 include/linux/delayacct.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN include/linux/delayacct.h~per-task-delay-accounting-taskstats-interface-fix-3 include/linux/delayacct.h
--- linux-2.6.17-rc5/include/linux/delayacct.h~per-task-delay-accounting-taskstats-interface-fix-3	2006-06-07 22:57:12.000000000 +0530
+++ linux-2.6.17-rc5-balbir/include/linux/delayacct.h	2006-06-07 22:57:39.000000000 +0530
@@ -80,8 +80,10 @@ static inline void delayacct_blkio_end(v
 static inline int delayacct_add_tsk(struct taskstats *d,
 					struct task_struct *tsk)
 {
-	if (!tsk->delays)
+	if (likely(!delayacct_on))
 		return -EINVAL;
+	if (!tsk->delays)
+		return 0;
 	return __delayacct_add_tsk(d, tsk);
 }
 
_

-- 

	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux