From 3968a5bca4fc0cdb4e2bb9fd6169deafdafc420d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 4 Mar 2025 10:31:02 -0500 Subject: 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 Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Knyszek --- src/runtime/proc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/proc.go') diff --git a/src/runtime/proc.go b/src/runtime/proc.go index c7ae71a136..8f603021e5 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2256,7 +2256,7 @@ func allocm(pp *p, fn func(), id int64) *m { unlock(&sched.lock) } - mp := new(m) + mp := &new(mPadded).m mp.mstartfn = fn mcommoninit(mp, id) -- cgit v1.3