]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add padding to m struct for 64 bit architectures
authorJoel Sing <joel@sing.id.au>
Thu, 27 Feb 2025 13:26:48 +0000 (00:26 +1100)
committerKeith Randall <khr@golang.org>
Sat, 1 Mar 2025 17:22:41 +0000 (09:22 -0800)
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>
src/runtime/runtime2.go

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