Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbcKIJLh (ORCPT ); Wed, 9 Nov 2016 04:11:37 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:38530 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbcKIJLb (ORCPT ); Wed, 9 Nov 2016 04:11:31 -0500 X-AuditID: cbfee61a-f79916d0000062de-aa-5822e80e9f4b From: Jaewon Kim To: brian.starkey@arm.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@samsung.com Subject: [PATCH] [RFC] drivers: dma-coherent: use MEMREMAP_WB instead of MEMREMAP_WC Date: Wed, 09 Nov 2016 18:10:09 +0900 Message-id: <1478682609-26477-1-git-send-email-jaewon31.kim@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t9jQV2+F0oRBqu3KFs8OnWB0aL3/Ssm i8u75rBZ3Fvzn9WBxWPNvDWMHps+TWL36NuyitHj8ya5AJYoN5uM1MSU1CKF1Lzk/JTMvHRb pdAQN10LJYW8xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsluGVcWXuIqWArZ8WUvkls DYzv2bsYOTgkBEwkJrXadzFyApliEhfurWfrYuTiEBKYxSix8f5JRginiUmiacYNZpAqNgFt ifcLJrGC2CICkhL7J74As5kF/CT2LjoDNlRYIEziyPw6kDCLgKpE1539YK28Ah4SD3dPZIRY Jidx8thk1gmM3AsYGVYxSqQWJBcUJ6XnGuallusVJ+YWl+al6yXn525iBAfeM6kdjAd3uR9i FOBgVOLhPfBYMUKINbGsuDL3EKMEB7OSCC/vU6UIId6UxMqq1KL8+KLSnNTiQ4ymQAdMZJYS Tc4HRkVeSbyhibmJubGBhbmlpYmRkjhv4+xn4UIC6YklqdmpqQWpRTB9TBycUg2MRhoGShNC Exf6iQVebhRfEP/srdaCCsu9ilOapudmy27ecVJkybcMvlmtl2RY3j6bsbj7pKFvt9yc9TZM 8ma/v+ZuSfqt/0ti/f+qeY+4mv0tOTg3yW6dpZWy6u6CI3/9ujbkssvoLJQMYWE9eXXCzlsP szpfc7At0bjJUCxkmrDNpMafgf2+EktxRqKhFnNRcSIAFBHlTlICAAA= X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1172 Lines: 31 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 --- 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