From: Jeff Garzik <jgarzik@pobox.com>
To: Mark Lord <liml@rtr.ca>
Cc: Tejun Heo <htejun@gmail.com>, Alan Cox <alan@redhat.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: Correct use of ap->lock versus ap->host->lock ?
Date: Thu, 06 Mar 2008 12:57:20 -0500 [thread overview]
Message-ID: <47D03080.8070405@pobox.com> (raw)
In-Reply-To: <47D02BB2.9000609@rtr.ca>
Mark Lord wrote:
> There are definitely other fish to fry elsewhere,
> but don't discount the effect of "a couple register writes",
> which are frequently done with readbacks to flush them,
> at a cost equivalent to several thousand CPU cycles per readback.
Those numbers are for slower PIO, not MMIO as found on new SATA
controllers...
> This prevents new command issue from overlapping interrupt handling
> for any ports of the same host. Again, not a biggie today,
> but tomorrow perhaps..
>
> And still probably not worth the fuss on any hardware that has
> registers shared across multiple ports (eg. Marvell controllers).
Remember, I come from the land of networking, where we already see over
500k packets per second. None of this is new stuff.
In networking you lock both TX submission (analogy: scsi queuecommand)
and TX completion (analogy: completion via irq handler), and we don't
see any such problems on multi-port controllers.
It is not worth the fuss on new SATA controllers, which look just like
NIC hardware has looked for a decade -- DMA rings, with a single MMIO
write (or write+read) to indicate software has new packets for hardware.
Even at exponentially higher FIS rates, locking doesn't become an issue.
And its not worth the fuss for older controllers, because they're, well,
old and SMP locking performance is not a pressing issue there. :)
Off the top of my head, here are two issues much more pressing than
host-versus-port libata locking:
* batch submission. The block and scsi layers pass commands to us
one-at-a-time, which is awful for any modern hardware. For each command
in the request queue: lock+queuecommand+unlock. It is better for both
locking and hardware (DMA ring) submission to add a batch of commands to
the queue, and then kick the hardware.
* figuring out an interrupt mitigation scheme that is useful in the real
world. Right now, even a 16-port SATA card will not give you a lot of
interrupts. At some point, it does become useful to turn on interrupt
mitigation.
That point is dynamic, and must be measured as such: it depends on
overall system load (not just load on a single SATA chip). Networking's
NAPI takes this into account, though over time we've seen the best
results by combining hardware interrupt mitigation with software
interrupt mitigation.
Regards,
Jeff
next prev parent reply other threads:[~2008-03-06 17:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 15:48 Correct use of ap->lock versus ap->host->lock ? Mark Lord
2008-03-06 16:35 ` Jeff Garzik
2008-03-06 17:13 ` Mark Lord
2008-03-06 17:24 ` Mark Lord
2008-03-06 17:41 ` Jeff Garzik
2008-03-06 18:12 ` Jeff Garzik
2008-03-06 23:04 ` Tejun Heo
2008-03-06 17:28 ` Jeff Garzik
2008-03-06 17:36 ` Mark Lord
2008-03-06 17:57 ` Jeff Garzik [this message]
2008-03-06 18:20 ` Mark Lord
2008-03-06 18:24 ` Jeff Garzik
2008-03-07 11:47 ` Andi Kleen
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=47D03080.8070405@pobox.com \
--to=jgarzik@pobox.com \
--cc=alan@redhat.com \
--cc=htejun@gmail.com \
--cc=liml@rtr.ca \
--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).