From b199d9766a8957c686ece568483586f08fc9a8b4 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Fri, 28 Feb 2025 00:26:48 +1100 Subject: [PATCH] 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Reviewed-by: Keith Randall --- src/runtime/runtime2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index b8579d9599..0c70d2cc81 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -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 }