]> Cypherpunks repositories - gostls13.git/commit
runtime: store zero-delay mutex contention events
authorRhys Hiltner <rhys.hiltner@gmail.com>
Fri, 16 Aug 2024 01:47:38 +0000 (18:47 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 19 Aug 2024 15:50:50 +0000 (15:50 +0000)
commit433c1d3b4ab41fa4272bd61f8ad2918ccd1e390d
tree4ea7a0a03bcf6f2849d13a833ad9e17d67de035d
parent3d9a89b05733f6787900ea7034aab0471e065946
runtime: store zero-delay mutex contention events

Mutex contention events with delay of 0 need more than CL 604355 added:
When deciding which event to store in the M's single available slot,
always choose to drop the zero-delay event. Store an explicit flag for
whether we have an event to store, rather than relying on a non-zero
delay.

And, fix a test of sync.Mutex contention that expects those events to
have non-zero delay. The reporting of non-runtime contention like this
has long allowed zero-delay events, which we see when cputicks has low
resolution.

Fixes #68892
Fixes #68906

Change-Id: Id412141e4eb09724f3ce195899a20d59c92d7b78
Reviewed-on: https://go-review.googlesource.com/c/go/+/606115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mprof.go
src/runtime/pprof/pprof_test.go