From: Balbir Singh <balbir@in.ibm.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: Balbir Singh <balbir@in.ibm.com>
Subject: [PATCH -mm] Fix return value of delayacct_add_tsk()
Date: Wed, 07 Jun 2006 23:06:36 +0530 [thread overview]
Message-ID: <20060607173636.31231.39254.sendpatchset@localhost.localdomain> (raw)
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
reply other threads:[~2006-06-07 17:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060607173636.31231.39254.sendpatchset@localhost.localdomain \
--to=balbir@in.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox