]> Cypherpunks repositories - gostls13.git/commitdiff
internal/cpu: fix cpu cacheLineSize for loong64
authorGuoqi Chen <chenguoqi@loongson.cn>
Thu, 26 May 2022 11:38:02 +0000 (19:38 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 26 May 2022 20:17:08 +0000 (20:17 +0000)
We choose 64 because the L1 Dcache of Loongson 3A5000 CPU is
4-way 256-line 64-byte-per-line.

Change-Id: Ifb9a9f993dd6f75b5adb4ff6e4d93e945b1b2a98
Reviewed-on: https://go-review.googlesource.com/c/go/+/408854
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/internal/cpu/cpu_loong64.go

index d8403d731ace7aa1a576d1df7a6016c9576f4e6d..1c90c24fe318d9e1b902038500468751773930c5 100644 (file)
@@ -6,6 +6,8 @@
 
 package cpu
 
-const CacheLinePadSize = 32
+// CacheLinePadSize is used to prevent false sharing of cache lines.
+// We choose 64 because Loongson 3A5000 the L1 Dcache is 4-way 256-line 64-byte-per-line.
+const CacheLinePadSize = 64
 
 func doinit() {}