* [PATCH -mm] Fix return value of delayacct_add_tsk()
@ 2006-06-07 17:36 Balbir Singh
0 siblings, 0 replies; only message in thread
From: Balbir Singh @ 2006-06-07 17:36 UTC (permalink / raw)
To: akpm, linux-kernel; +Cc: Balbir Singh
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 <balbir@in.ibm.com>
Signed-off-by: Shailabh Nagar <nagar@us.ibm.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-06-07 17:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-07 17:36 [PATCH -mm] Fix return value of delayacct_add_tsk() Balbir Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox