Skip to content

Commit aaa6b53

Browse files
ceseominux
authored andcommitted
runtime: insufficient padding in the p structure
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 <[email protected]> Reviewed-by: Minux Ma <[email protected]> Run-TryBot: Michael Munday <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent db1fef7 commit aaa6b53

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/runtime/internal/sys/arch_ppc64.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package sys
77
const (
88
ArchFamily = PPC64
99
BigEndian = 1
10-
CacheLineSize = 64
10+
CacheLineSize = 128
1111
PhysPageSize = 65536
1212
PCQuantum = 4
1313
Int64Align = 8

src/runtime/internal/sys/arch_ppc64le.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package sys
77
const (
88
ArchFamily = PPC64
99
BigEndian = 0
10-
CacheLineSize = 64
10+
CacheLineSize = 128
1111
PhysPageSize = 65536
1212
PCQuantum = 4
1313
Int64Align = 8

src/runtime/runtime2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ type p struct {
498498

499499
runSafePointFn uint32 // if 1, run sched.safePointFn at next safe point
500500

501-
pad [64]byte
501+
pad [sys.CacheLineSize]byte
502502
}
503503

504504
const (

0 commit comments

Comments
 (0)