All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue
@ 2008-07-06 13:23 Matthew Wilcox
  2008-07-06 13:44 ` Jeff Garzik
  2008-07-11 13:49 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Wilcox @ 2008-07-06 13:23 UTC (permalink / raw)
  To: linux-ide; +Cc: jgarzik, Matthew Wilcox, Matthew Wilcox

In an I/O heavy workload (IOZone), ahci_qc_issue is the second-highest
consumer of CPU cycles.  Removing the flush gets us approximately 10%
bandwidth improvement.  I believe this to be because the CPU can start
queueing the next request instead of waiting for the readl() to flush the
writes to the device.  The flush isn't necessary because we're using a
'queue' metaphor; we don't guarantee the command has got to the device,
nor do we need to guarantee the command has got to the controller.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
---
 drivers/ata/ahci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 6a7a70a..58915bd 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1846,7 +1846,6 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
 	if (qc->tf.protocol == ATA_PROT_NCQ)
 		writel(1 << qc->tag, port_mmio + PORT_SCR_ACT);
 	writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE);
-	readl(port_mmio + PORT_CMD_ISSUE);	/* flush */
 
 	return 0;
 }
-- 
1.5.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue
  2008-07-06 13:23 [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue Matthew Wilcox
@ 2008-07-06 13:44 ` Jeff Garzik
  2008-07-11 13:49 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2008-07-06 13:44 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-ide, Matthew Wilcox, LKML

Matthew Wilcox wrote:
> In an I/O heavy workload (IOZone), ahci_qc_issue is the second-highest
> consumer of CPU cycles.  Removing the flush gets us approximately 10%
> bandwidth improvement.  I believe this to be because the CPU can start
> queueing the next request instead of waiting for the readl() to flush the
> writes to the device.  The flush isn't necessary because we're using a
> 'queue' metaphor; we don't guarantee the command has got to the device,
> nor do we need to guarantee the command has got to the controller.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> ---
>  drivers/ata/ahci.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 6a7a70a..58915bd 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1846,7 +1846,6 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
>  	if (qc->tf.protocol == ATA_PROT_NCQ)
>  		writel(1 << qc->tag, port_mmio + PORT_SCR_ACT);
>  	writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE);
> -	readl(port_mmio + PORT_CMD_ISSUE);	/* flush */
>  

(LKML CC added for wider review)

As I noted in IRC, I've queued this and am planning to apply this, as 
I've been thinking along the same lines for quite a while now...  not 
just in this driver but other drivers too.

A couple places in libata arguably need additional flushing, but some 
places could actually stand to use /less/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue
  2008-07-06 13:23 [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue Matthew Wilcox
  2008-07-06 13:44 ` Jeff Garzik
@ 2008-07-11 13:49 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2008-07-11 13:49 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-ide, Matthew Wilcox

Matthew Wilcox wrote:
> In an I/O heavy workload (IOZone), ahci_qc_issue is the second-highest
> consumer of CPU cycles.  Removing the flush gets us approximately 10%
> bandwidth improvement.  I believe this to be because the CPU can start
> queueing the next request instead of waiting for the readl() to flush the
> writes to the device.  The flush isn't necessary because we're using a
> 'queue' metaphor; we don't guarantee the command has got to the device,
> nor do we need to guarantee the command has got to the controller.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> ---
>  drivers/ata/ahci.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 6a7a70a..58915bd 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1846,7 +1846,6 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
>  	if (qc->tf.protocol == ATA_PROT_NCQ)
>  		writel(1 << qc->tag, port_mmio + PORT_SCR_ACT);
>  	writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE);
> -	readl(port_mmio + PORT_CMD_ISSUE);	/* flush */
>  

applied



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-11 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-06 13:23 [PATCH] AHCI: Remove an unnecessary flush from ahci_qc_issue Matthew Wilcox
2008-07-06 13:44 ` Jeff Garzik
2008-07-11 13:49 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.