linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: cache: Update cache_line_size for HiSilicon certain platform
@ 2019-03-26  6:28 Shaokun Zhang
  2019-03-26 14:55 ` Catalin Marinas
  0 siblings, 1 reply; 16+ messages in thread
From: Shaokun Zhang @ 2019-03-26  6:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Catalin Marinas, John Garry, Will Deacon, Shaokun Zhang,
	Zhenfa Qiu, Hanjun Guo

For HiSilicon's certain platform, like Kunpeng920 server SoC, it uses the
tsv110 CPUs whose L1 cache line size is 64-Byte, while the cache line size
of L3C is 128-Byte.
cache_line_size is used mostly for IO device drivers, so we shall correct
the right value and the device drivers can match it accurately to get good
performance.

When test mlx5 with Kunpeng920 SoC, ib_send_bw is run under the condition
that the length of the packet is 4-Byte and only one queue and cpu core:
Without this patch: 1.67 Mpps
with this patch   : 2.40 Mpps

Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Zhenfa Qiu <qiuzhenfa@hisilicon.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Reported-by: Zhenfa Qiu <qiuzhenfa@hisilicon.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 arch/arm64/include/asm/cache.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h
index 926434f413fa..0f7d9581e0b9 100644
--- a/arch/arm64/include/asm/cache.h
+++ b/arch/arm64/include/asm/cache.h
@@ -93,7 +93,12 @@ static inline u32 cache_type_cwg(void)
 
 static inline int cache_line_size(void)
 {
-	u32 cwg = cache_type_cwg();
+	u32 cwg;
+
+	if (read_cpuid_part_number() == HISI_CPU_PART_TSV110)
+		return ARCH_DMA_MINALIGN;
+
+	cwg = cache_type_cwg();
 	return cwg ? 4 << cwg : ARCH_DMA_MINALIGN;
 }
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-17  3:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-26  6:28 [PATCH] arm64: cache: Update cache_line_size for HiSilicon certain platform Shaokun Zhang
2019-03-26 14:55 ` Catalin Marinas
2019-03-27  7:16   ` Zhangshaokun
2019-03-29 18:52     ` Catalin Marinas
2019-04-02  7:51       ` Zhangshaokun
2019-04-03 12:57         ` Catalin Marinas
2019-04-08  7:51           ` Zhangshaokun
2019-04-16 13:51             ` Will Deacon
2019-04-16 14:23               ` Zhangshaokun
2019-04-16 14:59                 ` Catalin Marinas
2019-04-17  3:41                   ` Zhangshaokun
2019-04-04 10:27         ` Catalin Marinas
2019-04-05  8:29           ` John Garry
2019-04-08  8:24           ` Zhangshaokun
2019-04-02 13:02       ` Suzuki K Poulose
2019-04-08  8:33         ` Zhangshaokun

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