]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: insufficient padding in the `p` structure
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Fri, 29 Jul 2016 17:02:26 +0000 (14:02 -0300)
committerMinux Ma <minux@golang.org>
Mon, 29 Aug 2016 23:22:51 +0000 (23:22 +0000)
The current padding in the 'p' struct is hardcoded at 64 bytes. It should be the
cache line size. On ppc64x, the current value is only okay because sys.CacheLineSize
is wrong at 64 bytes. This change fixes that by making the padding equal to the
cache line size. It also fixes the cache line size for ppc64/ppc64le to 128 bytes.

Fixes #16477

Change-Id: Ib7ec5195685116eb11ba312a064f41920373d4a3
Reviewed-on: https://go-review.googlesource.com/25370
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/internal/sys/arch_ppc64.go
src/runtime/internal/sys/arch_ppc64le.go
src/runtime/runtime2.go

index cdec63ff71125dd3a29662b9cab69a526df84da5..f908ce21739b131d6d57de3b7bd5754f255854cb 100644 (file)
@@ -7,7 +7,7 @@ package sys
 const (
        ArchFamily    = PPC64
        BigEndian     = 1
-       CacheLineSize = 64
+       CacheLineSize = 128
        PhysPageSize  = 65536
        PCQuantum     = 4
        Int64Align    = 8
index 4fd68f9ce3aa66b239d318f19e5882e0c2844732..3d95f9e96cef6125c71bb1f07a86e43be1e22972 100644 (file)
@@ -7,7 +7,7 @@ package sys
 const (
        ArchFamily    = PPC64
        BigEndian     = 0
-       CacheLineSize = 64
+       CacheLineSize = 128
        PhysPageSize  = 65536
        PCQuantum     = 4
        Int64Align    = 8
index 24f85d943d27aa8b2f12ef82c8c32ffd3c89cffc..2e886742b5289ae358e7bc6f7a4610613e375fc0 100644 (file)
@@ -498,7 +498,7 @@ type p struct {
 
        runSafePointFn uint32 // if 1, run sched.safePointFn at next safe point
 
-       pad [64]byte
+       pad [sys.CacheLineSize]byte
 }
 
 const (