From: Jeff Garzik <jgarzik@pobox.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux-ide <linux-ide@vger.kernel.org>,
tj@kernel.org, "Zhang, Yanmin" <yanmin.zhang@intel.com>
Subject: Re: NCQ is slower in some cases?
Date: Thu, 23 Jul 2009 00:01:46 -0400 [thread overview]
Message-ID: <4A67E0AA.6060405@pobox.com> (raw)
In-Reply-To: <1248320643.9035.19.camel@sli10-desk.sh.intel.com>
Shaohua Li wrote:
> Hi,
> I did some tests about NCQ. It appears enabling NCQ sometimes will make
> disk slower than disabling it (well it does improve performance in
> random io case). Test using fio with attached script.
> With queue_depth 1 (so NCQ is disabled), the disk speed is about 27m/s.
> with queue_depth 2 - 31, the speed is about 24m/s.
>
> blktrace shows the Q2C time with NCQ enabled increases about 10%.
> Specifically the D2C time increases and time of other stages hasn't
> obvious changes.
>
> I added a 'udelay()' at the end of ahci_qc_issue(), as my test does
> 'submit a request, wait it and then submit another', so if the udelay
> time is shorter than the disk io time, the udelay should not be harmful.
> My test shows when the udelay time is smaller than 90us, the delay
> hasn't any impact to the ncq enabled case. On the other hand, the udelay
> time should be shorter than 30us otherwise the ncq disabled case has
> obvious performance downgrade. This test seems suggesting diskio is
> slower in ncq enabled. Is the single diskio slow in ncq case expected?
You should test disks from different vendors and generations...
NCQ is _usually_ a win, especially for multi-threaded applications.
Tests from years ago seemed to indicate that the advantage maxed out at
4-8 queued commands, and added little value after that.
In addition, some NCQ disks and some system workloads may underperform,
but this does not seem to be the general case.
Updated tests and numbers welcomed!
Jeff
next prev parent reply other threads:[~2009-07-23 4:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 3:44 NCQ is slower in some cases? Shaohua Li
2009-07-23 4:01 ` Jeff Garzik [this message]
2009-07-23 5:48 ` Shaohua Li
2009-07-23 15:39 ` Mark Lord
2009-07-23 18:04 ` Robert Hancock
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=4A67E0AA.6060405@pobox.com \
--to=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=shaohua.li@intel.com \
--cc=tj@kernel.org \
--cc=yanmin.zhang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).