mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: "'Arjan van de Ven'" <arjan@infradead.org>
Cc: <linux-kernel@vger.kernel.org>, "'Jens Axboe'" <axboe@suse.de>
Subject: RE: [patch] optimize disk_round_stats
Date: Fri, 14 Oct 2005 12:16:54 -0700	[thread overview]
Message-ID: <200510141917.j9EJHEg20883@unix-os.sc.intel.com> (raw)
In-Reply-To: <1129285187.2873.7.camel@laptopd505.fenrus.org>

Arjan van de Ven wrote on Friday, October 14, 2005 3:20 AM
> On Thu, 2005-10-13 at 12:19 -0700, Chen, Kenneth W wrote:
> > 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.
> 
> have you measured this?
> Conditionals in code are not free, so it might well be more expensive...

Yes I did, on a null block driver[1], this optimization gets about
2% improvement.  The reasoning is that for example, user submits
100,000 I/O per second, we only need to update the stats per jiffies.
With latest kernel have 250 Hz as default.  It's 250 updates versus
100,000 updates (with 99,750 updates of adding zero).  I see that the
condition is well worth it.  The address calculation for per cpu disk
stats has lots of indirection and index calculation.  Compiler generates
lots of code just for address calculation.

- Ken


[1] this driver completes an I/O request as soon as it enters block queue.


      reply	other threads:[~2005-10-14 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 19:19 Chen, Kenneth W
2005-10-13 19:22 ` Jens Axboe
2005-10-14 10:19 ` Arjan van de Ven
2005-10-14 19:16   ` Chen, Kenneth W [this message]

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=200510141917.j9EJHEg20883@unix-os.sc.intel.com \
    --to=kenneth.w.chen@intel.com \
    --cc=arjan@infradead.org \
    --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®