From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: <linux-kernel@vger.kernel.org>
Cc: "'Jens Axboe'" <axboe@suse.de>
Subject: [patch] optimize disk_round_stats
Date: Thu, 13 Oct 2005 12:19:23 -0700 [thread overview]
Message-ID: <200510131919.j9DJJkg07781@unix-os.sc.intel.com> (raw)
Following the same idea, it occurs to me that we should only update
disk stat when "now" is different from disk->stamp. Otherwise, we
are again needlessly adding zero to the stats.
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
--- ./drivers/block/ll_rw_blk.c.orig 2005-10-13 11:54:07.474907379 -0700
+++ ./drivers/block/ll_rw_blk.c 2005-10-13 11:54:39.074516367 -0700
@@ -2433,6 +2433,9 @@ void disk_round_stats(struct gendisk *di
{
unsigned long now = jiffies;
+ if (now == disk->stamp)
+ return;
+
if (disk->in_flight) {
__disk_stat_add(disk, time_in_queue,
disk->in_flight * (now - disk->stamp));
next reply other threads:[~2005-10-13 19:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-13 19:19 Chen, Kenneth W [this message]
2005-10-13 19:22 ` Jens Axboe
2005-10-14 10:19 ` Arjan van de Ven
2005-10-14 19:16 ` Chen, Kenneth W
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=200510131919.j9DJJkg07781@unix-os.sc.intel.com \
--to=kenneth.w.chen@intel.com \
--cc=axboe@suse.de \
--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®