From: Shailabh Nagar <nagar@watson.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Balbir Singh <balbir@in.ibm.com>,
Chris Sturtivant <csturtiv@sgi.com>
Subject: [Patch 1/3] make taskstats sending completely independent of delay accounting on/off status
Date: Mon, 17 Jul 2006 17:52:38 -0400 [thread overview]
Message-ID: <1153173158.4551.13.camel@dyn9002218086.watson.ibm.com> (raw)
In-Reply-To: <1153173063.4551.10.camel@dyn9002218086.watson.ibm.com>
Complete the separation of delay accounting and taskstats by ignoring the
return value of delay accounting functions that fill in parts of taskstats
before it is sent out (either in response to a command or as part of a task
exit).
Also make delayacct_add_tsk return silently when delay accounting is turned
off rather than treat it as an error.
Signed-Off-By: Shailabh Nagar <nagar@watson.ibm.com>
include/linux/delayacct.h | 4 +---
kernel/taskstats.c | 8 +++-----
2 files changed, 4 insertions(+), 8 deletions(-)
Index: linux-2.6.18-rc2/kernel/taskstats.c
===================================================================
--- linux-2.6.18-rc2.orig/kernel/taskstats.c 2006-07-17 17:01:51.000000000 -0400
+++ linux-2.6.18-rc2/kernel/taskstats.c 2006-07-17 17:03:41.000000000 -0400
@@ -177,7 +177,7 @@ static int send_cpu_listeners(struct sk_
static int fill_pid(pid_t pid, struct task_struct *pidtsk,
struct taskstats *stats)
{
- int rc;
+ int rc = 0;
struct task_struct *tsk = pidtsk;
if (!pidtsk) {
@@ -196,12 +196,10 @@ static int fill_pid(pid_t pid, struct ta
* Each accounting subsystem adds calls to its functions to
* fill in relevant parts of struct taskstsats as follows
*
- * rc = per-task-foo(stats, tsk);
- * if (rc)
- * goto err;
+ * per-task-foo(stats, tsk);
*/
- rc = delayacct_add_tsk(stats, tsk);
+ delayacct_add_tsk(stats, tsk);
stats->version = TASKSTATS_VERSION;
/* Define err: label here if needed */
Index: linux-2.6.18-rc2/include/linux/delayacct.h
===================================================================
--- linux-2.6.18-rc2.orig/include/linux/delayacct.h 2006-07-17 17:01:51.000000000 -0400
+++ linux-2.6.18-rc2/include/linux/delayacct.h 2006-07-17 17:03:41.000000000 -0400
@@ -80,9 +80,7 @@ static inline void delayacct_blkio_end(v
static inline int delayacct_add_tsk(struct taskstats *d,
struct task_struct *tsk)
{
- if (likely(!delayacct_on))
- return -EINVAL;
- if (!tsk->delays)
+ if (likely(!delayacct_on) || !tsk->delays)
return 0;
return __delayacct_add_tsk(d, tsk);
}
next prev parent reply other threads:[~2006-07-17 21:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-17 21:51 [Patch 0/3] delay accounting fixes Shailabh Nagar
2006-07-17 21:52 ` Shailabh Nagar [this message]
2006-07-17 21:54 ` [Patch 2/3] taskstats: free skb, avoid returns in send_cpu_listeners Shailabh Nagar
2006-07-17 21:56 ` [Patch 3/3] delay accounting: temporarily enable by default Shailabh Nagar
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=1153173158.4551.13.camel@dyn9002218086.watson.ibm.com \
--to=nagar@watson.ibm.com \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=csturtiv@sgi.com \
--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
all inboxes | Powered by JetHome®