runtime: add padding to m struct for 64 bit architectures

CL 652276 reduced the m struct by 8 bytes, which has changed the
allocation class on 64 bit OpenBSD platforms. This results in build
failures due to:

    M structure uses sizeclass 1792/0x700 bytes; incompatible with mutex flag mask 0x3ff

Add 128 bytes of padding when spinbitmutex is enabled on 64 bit
architectures, moving the size to the half point between the
1792 and 2048 allocation size.

Change-Id: I71623a1f75714543c302217e619d20cf0e717aeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/653335
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Joel Sing 2025-02-28 00:26:48 +11:00 committed by Keith Randall
parent 5a7db813a6
commit b199d9766a

View File

@ -624,6 +624,7 @@ type m struct {
// not in the next-smallest (1792-byte) size class. That leaves the 11 low // not in the next-smallest (1792-byte) size class. That leaves the 11 low
// bits of muintptr values available for flags, as required for // bits of muintptr values available for flags, as required for
// GOEXPERIMENT=spinbitmutex. // GOEXPERIMENT=spinbitmutex.
_ [goexperiment.SpinbitMutexInt * 64 * goarch.PtrSize / 8]byte
_ [goexperiment.SpinbitMutexInt * 700 * (2 - goarch.PtrSize/4)]byte _ [goexperiment.SpinbitMutexInt * 700 * (2 - goarch.PtrSize/4)]byte
} }