diff options
| author | Russ Cox <rsc@golang.org> | 2025-03-04 10:31:02 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-04-11 12:24:59 -0700 |
| commit | 3968a5bca4fc0cdb4e2bb9fd6169deafdafc420d (patch) | |
| tree | d78415165d6bbc9f77fc38a452a12217fb675bfd /src/runtime/lock_spinbit.go | |
| parent | c77ada1b78ae83c88a4e964a7cbfa2e708073d8b (diff) | |
| download | go-3968a5bca4fc0cdb4e2bb9fd6169deafdafc420d.tar.xz | |
runtime: handle m0 padding better
The SpinbitMutex experiment requires m structs other than m0
to be allocated in 2048-byte size class, by adding padding.
Do the calculation more explicitly, to avoid future CLs like CL 653335.
Change-Id: I83ae1e86ef3711ab65441f4e487f94b9e1429029
Reviewed-on: https://go-review.googlesource.com/c/go/+/654595
Reviewed-by: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/lock_spinbit.go')
| -rw-r--r-- | src/runtime/lock_spinbit.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/lock_spinbit.go b/src/runtime/lock_spinbit.go index 7e84f3e1c2..ba5268abdd 100644 --- a/src/runtime/lock_spinbit.go +++ b/src/runtime/lock_spinbit.go @@ -90,7 +90,7 @@ type mWaitList struct { // lockVerifyMSize confirms that we can recreate the low bits of the M pointer. func lockVerifyMSize() { - size := roundupsize(unsafe.Sizeof(m{}), false) + mallocHeaderSize + size := roundupsize(unsafe.Sizeof(mPadded{}), false) + mallocHeaderSize if size&mutexMMask != 0 { print("M structure uses sizeclass ", size, "/", hex(size), " bytes; ", "incompatible with mutex flag mask ", hex(mutexMMask), "\n") |
