Commit aaa6b535 authored by Carlos Eduardo Seo's avatar Carlos Eduardo Seo Committed by Minux Ma

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/25370Reviewed-by: 's avatarLynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent db1fef7b
......@@ -7,7 +7,7 @@ package sys
const (
ArchFamily = PPC64
BigEndian = 1
CacheLineSize = 64
CacheLineSize = 128
PhysPageSize = 65536
PCQuantum = 4
Int64Align = 8
......
......@@ -7,7 +7,7 @@ package sys
const (
ArchFamily = PPC64
BigEndian = 0
CacheLineSize = 64
CacheLineSize = 128
PhysPageSize = 65536
PCQuantum = 4
Int64Align = 8
......
......@@ -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 (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment