linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Grundler" <grundler@google.com>
To: Mark Lord <liml@rtr.ca>
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
	Alan Cox <alan@redhat.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Harald Welte <laforge@gnumonks.org>
Subject: Re: [PATCH 09/09] sata_mv cache main_irq_mask register in hpriv
Date: Mon, 19 May 2008 11:27:49 -0700	[thread overview]
Message-ID: <da824cf30805191127p1069d568h2049c5d00ff69387@mail.gmail.com> (raw)
In-Reply-To: <482F17F8.3010403@rtr.ca>

On Sat, May 17, 2008 at 10:38 AM, Mark Lord <liml@rtr.ca> wrote:
> Part five of simplifying/fixing handling of the main_irq_mask register
> to resolve unexpected interrupt issues observed in 2.6.26-rc*.
>
> Keep a cached copy of the main_irq_mask so that we don't have
> to stall the CPU to read it on every pass through mv_interrupt.
>
> This significantly speeds up interrupt handling, both for sata_mv,
> and for any other driver/device sharing the same PCI IRQ line.

To be precise, it saves about ~1% of cpu cycles of ~2Ghz CPU
as measured by oprofile. "fio" provided the workload by sequentially
reading 4K blocks from 4 normal SATA II disks (about 8K IO/s per disk).
This is expected to be similar to using SSDs.
So not a huge win; just an easy one.

Here is the cost of one MMIO read on a not-to-old intel PCI-e chipset:
0a:00.0 (11ab:7042): sata_mv from CPU0                   SATAHC0Cause
(20014):  1345 cycles   576 ns
0a:00.0 (11ab:7042): sata_mv from CPU0                      main_mask
(1d64):  1302 cycles   558 ns
0a:00.0 (11ab:7042): sata_mv from CPU0                     main_cause
(1d60):  1302 cycles   558 ns

I'll note this is extremely fast since there are no PCI-PCI bridges
and the 7042 controller seems to respond very quickly.
More typical is 1000ns or so.

thanks,
grant

(1) svn co http://svn.gnumonks.org/trunk/mmio_test/

Plus this patch:
    http://iou.parisc-linux.org/~grundler/diff/diff-mmio_test-02

  parent reply	other threads:[~2008-05-19 18:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14 13:18 [PATCH 01/04] sata_mv always do softreset Mark Lord
2008-05-14 13:19 ` [PATCH 02/04] sata_mv fis irq register fixes Mark Lord
2008-05-14 13:21   ` [PATCH 03/04] sata_mv group genIIe flags Mark Lord
2008-05-14 13:24     ` [PATCH 04/04] sata_mv async notify for genIIe only Mark Lord
2008-05-17 17:34       ` [PATCH 05/09] sata_mv don't blindly enable IRQs Mark Lord
2008-05-17 17:35         ` [PATCH 06/09] sata_mv consolidate main_irq_mask updates Mark Lord
2008-05-17 17:36           ` [PATCH 07/09] sata_mv fix pmp drives not found Mark Lord
2008-05-17 17:37             ` [PATCH 08/09] sata_mv disregard masked irqs Mark Lord
2008-05-17 17:38               ` [PATCH 09/09] sata_mv cache main_irq_mask register in hpriv Mark Lord
2008-05-19 13:01                 ` [PATCH 10/10] sata_mv: ensure empty request queue for FBS-NCQ EH Mark Lord
2008-05-19 21:41                   ` Jeff Garzik
2008-05-19 21:42                   ` Jeff Garzik
2008-05-19 18:27                 ` Grant Grundler [this message]
2008-05-17 17:41         ` [PATCH 05/09] sata_mv don't blindly enable IRQs Jeff Garzik
2008-05-17 17:45           ` Mark Lord
2008-05-17 17:49             ` Jeff Garzik

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=da824cf30805191127p1069d568h2049c5d00ff69387@mail.gmail.com \
    --to=grundler@google.com \
    --cc=alan@redhat.com \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=laforge@gnumonks.org \
    --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).