]> Cypherpunks repositories - gostls13.git/commit
runtime: profile mutex contention during unlock
authorRhys Hiltner <rhys.hiltner@gmail.com>
Tue, 14 May 2024 19:32:14 +0000 (12:32 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 21 May 2024 17:17:34 +0000 (17:17 +0000)
commitba1c5b2c4573e10f3b5f0e0f25a27f17fba67eb0
treece16b2e2da30b0ca4bca8c75fb89713aab7d8dca
parentd881ed6384ae58154d99682f1e20160c64e7c3c2
runtime: profile mutex contention during unlock

When an M's use of a lock causes delays in other Ms, capture the stack
of the unlock call that caused the delay. This makes the meaning of the
mutex profile for runtime-internal mutexes match the behavior for
sync.Mutex: the profile points to the end of the critical section that
is responsible for delaying other work.

Fixes #66999

Change-Id: I4abc4a1df00a48765d29c07776481a1cbd539ff8
Reviewed-on: https://go-review.googlesource.com/c/go/+/585638
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/lock_futex.go
src/runtime/lock_sema.go
src/runtime/mprof.go