From: Jens Axboe <jens.axboe@oracle.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Mark Hahn <hahn@physics.mcmaster.ca>,
linux-ide@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: ahci problems with sata disk.
Date: Thu, 18 Jan 2007 09:03:15 +1100 [thread overview]
Message-ID: <20070117220315.GF3508@kernel.dk> (raw)
In-Reply-To: <45AD4D62.5010308@garzik.org>
On Tue, Jan 16 2007, Jeff Garzik wrote:
> Mark Hahn wrote:
> >>>>I though that NCQ was intended to increase performance ??
> >
> >intended to increase _sales_ performance ;)
>
> Yep.
>
>
> >remember that you've always had command queueing (kernel elevator): the
> >main difference with NCQ (or SCSI tagged queueing) is when
> >the disk can out-schedule the kernel. afaikt, this means sqeezing
> >in a rotationally intermediate request along the way.
> >
> >that intermediate request must be fairly small and should be a read
> >(for head-settling reasons).
> >
> >I wonder how often this happens in the real world, given the relatively
> >small queues the disk has to work with.
>
> ISTR either Jens or Andrew ran some numbers, and found that there was
> little utility beyond 4 or 8 tags or so.
It entirely depends on the access pattern. For truly random reads,
performance does seem to continue to scale up with increasing drive
queue depths. It may only be a benchmark figure though, as truly random
read workloads probably aren't that common :-)
For anything else, going beyond 4 tags doesn't improve much.
> >>My hdparm test is a sequential read-ahead test, so it will
> >>naturally perform worse on a Raptor when NCQ is on.
> >
> >that's a surprisingly naive heuristic, especially since NCQ is concerned
> >with just a max of ~4MB of reads, only a smallish
> >fraction of the available cache.
>
> NCQ mainly helps with multiple threads doing reads. Writes are largely
> asynchronous to the user already (except for fsync-style writes). You
> want to be able to stuff the disk's internal elevator with as many read
> requests as possible, because reads are very often synchronous -- most
> apps (1) read a block, (2) do something, (3) goto step #1. The kernel's
> elevator isn't much use in these cases.
Au contraire, this is one of the cases where intelligent IO scheduling
in the kernel makes a ton of difference. It's the primary reason that AS
and CFQ are able to maintain > 90% of disk bandwidth for more than one
process, idling the drive for the duration of step 2 in the sequence
above (step 2 is typically really small, time wise). If the next block
read is close to the first one, that is. If you do that, you will
greatly outperform the same workload pushed to the drive scheduling.
I've done considerable benchmarks on this. Only if the processes are
doing random IO should the IO scheduler punt and push everything to the
drive queue.
--
Jens Axboe
prev parent reply other threads:[~2007-01-17 22:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-14 14:32 ahci problems with sata disk kenneth johansson
2007-01-15 9:13 ` Tejun Heo
2007-01-15 11:05 ` kenneth johansson
2007-01-15 11:36 ` Alan
2007-01-15 13:50 ` Tejun Heo
2007-01-16 1:43 ` kenneth johansson
2007-01-16 16:44 ` Andrew Lyon
2007-01-16 18:32 ` Mark Lord
2007-01-16 20:20 ` Mark Hahn
2007-01-16 22:10 ` Jeff Garzik
2007-01-16 22:26 ` Eric D. Mudama
2007-01-17 22:03 ` Jens Axboe
2007-01-17 22:03 ` Jens Axboe [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=20070117220315.GF3508@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=akpm@osdl.org \
--cc=hahn@physics.mcmaster.ca \
--cc=jeff@garzik.org \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).