linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] drivers: dma-coherent: use MEMREMAP_WB instead of MEMREMAP_WC
@ 2016-11-09  9:10 Jaewon Kim
  2016-11-09  9:27 ` Brian Starkey
  0 siblings, 1 reply; 9+ messages in thread
From: Jaewon Kim @ 2016-11-09  9:10 UTC (permalink / raw)
  To: brian.starkey; +Cc: linux-mm, linux-kernel, jaewon31.kim

Commit 6b03ae0d42bf (drivers: dma-coherent: use MEMREMAP_WC for DMA_MEMORY_MA)
added MEMREMAP_WC for DMA_MEMORY_MAP. If, however, CPU cache can be used on
DMA_MEMORY_MAP, I think MEMREMAP_WC can be changed to MEMREMAP_WB. On my local
ARM device, memset in dma_alloc_from_coherent sometimes takes much longer with
MEMREMAP_WC compared to MEMREMAP_WB.

Test results on AArch64 by allocating 4MB with putting trace_printk right
before and after memset.
	MEMREMAP_WC : 11.0ms, 5.7ms, 4.2ms, 4.9ms, 5.4ms, 4.3ms, 3.5ms
	MEMREMAP_WB : 0.7ms, 0.6ms, 0.6ms, 0.6ms, 0.6ms, 0.5ms, 0.4 ms

Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
---
 drivers/base/dma-coherent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
index 640a7e6..0512a1d 100644
--- a/drivers/base/dma-coherent.c
+++ b/drivers/base/dma-coherent.c
@@ -33,7 +33,7 @@ static bool dma_init_coherent_memory(
 		goto out;
 
 	if (flags & DMA_MEMORY_MAP)
-		mem_base = memremap(phys_addr, size, MEMREMAP_WC);
+		mem_base = memremap(phys_addr, size, MEMREMAP_WB);
 	else
 		mem_base = ioremap(phys_addr, size);
 	if (!mem_base)
-- 
1.9.1

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

end of thread, other threads:[~2016-11-16 15:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09  9:10 [PATCH] [RFC] drivers: dma-coherent: use MEMREMAP_WB instead of MEMREMAP_WC Jaewon Kim
2016-11-09  9:27 ` Brian Starkey
2016-11-09  9:47   ` Jaewon Kim
2016-11-09 10:23     ` Brian Starkey
2016-11-10  1:41       ` Jaewon Kim
2016-11-10  9:51         ` Brian Starkey
2016-11-11  9:53           ` Jaewon Kim
2016-11-15  8:07             ` Jaewon Kim
2016-11-16 15:29               ` Brian Starkey

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).