All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: set DMA_ATTR_WEAK_ORDERING attribute on dma buffers
@ 2017-06-16 20:34 Alan Adamson
  2017-06-17 11:57 ` Christoph Hellwig
  0 siblings, 1 reply; 15+ messages in thread
From: Alan Adamson @ 2017-06-16 20:34 UTC (permalink / raw)


SPARC based platforms suffer significant read performance penalties for
nvme reads when Relaxed Ordering is not enabled. This change sets the
DMA_ATTR_WEAK_ORDERING (Relaxed Ordering) attribute for nvme block dma
buffers.

Both the AIC and SSD versions of the Samsung 2.9TB device were tested
with fio using iodepth=32, numjobs=8, and bs=4k.

For reads, a 450% increase in IOPS was observed.
For writes, no change in IOPS was observed.

Signed-off-by: Alan Adamson <alan.adamson at oracle.com>
Tested-by: Alan Adamson <alan.adamson at oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin at oracle.com>
Reviewed-by: Govinda Tatti <govinda.tatti at oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson at oracle.com>

---
 drivers/nvme/host/pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 951042a375d6..7a6cf6fa95c2 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -632,7 +632,7 @@ static int nvme_map_data(struct nvme_dev *dev, struct request *req,
 
 	ret = BLK_MQ_RQ_QUEUE_BUSY;
 	if (!dma_map_sg_attrs(dev->dev, iod->sg, iod->nents, dma_dir,
-				DMA_ATTR_NO_WARN))
+				DMA_ATTR_NO_WARN | DMA_ATTR_WEAK_ORDERING))
 		goto out;
 
 	if (!nvme_setup_prps(dev, req))
@@ -650,7 +650,8 @@ static int nvme_map_data(struct nvme_dev *dev, struct request *req,
 		if (rq_data_dir(req))
 			nvme_dif_remap(req, nvme_dif_prep);
 
-		if (!dma_map_sg(dev->dev, &iod->meta_sg, 1, dma_dir))
+		if (!dma_map_sg_attrs(dev->dev, &iod->meta_sg, 1, dma_dir,
+				DMA_ATTR_WEAK_ORDERING))
 			goto out_unmap;
 	}
 
-- 
1.8.3.1

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

end of thread, other threads:[~2017-07-10 16:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-16 20:34 [PATCH] nvme: set DMA_ATTR_WEAK_ORDERING attribute on dma buffers Alan Adamson
2017-06-17 11:57 ` Christoph Hellwig
2017-06-21 20:30   ` Alan Adamson
     [not found]     ` <6a32f30b-433a-9857-164f-1717405a6082-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-06-24  7:35       ` DMA_ATTR_WEAK_ORDERING defintion, was " Christoph Hellwig
2017-06-24  7:35         ` Christoph Hellwig
2017-06-24  7:35         ` Christoph Hellwig
2017-06-26  9:15         ` Arnd Bergmann
2017-06-26  9:15           ` Arnd Bergmann
2017-06-27 20:46         ` chris hyser
2017-06-27 20:46           ` chris hyser
2017-07-05 19:07           ` Christoph Hellwig
2017-07-05 19:07             ` Christoph Hellwig
     [not found]             ` <20170705190714.GA7107-jcswGhMUV9g@public.gmane.org>
2017-07-10 16:17               ` chris hyser
2017-07-10 16:17                 ` chris hyser
2017-07-10 16:17                 ` chris hyser

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.