Skip to content

Report the contended hold duration from SpinLock::SlowUnlock. - #2415

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_991641114
Nov 2, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_991641114

Conversation

@copybara-service

Copy link
Copy Markdown

Report the contended hold duration from SpinLock::SlowUnlock.

SlowUnlock reported the releasing thread's own acquisition wait, which the
lock-side hook already reports. Instead, store in lock word bits [31:3] when
the current hold first had a sleeping waiter, and report the elapsed time at
unlock against the holder's stack, like Mutex's unlocking_delay.

The lock word protocol is unchanged: bits [31:3] are written at the same points
and are non-zero under the same conditions. Holds resolved while waiters spin
are not reported. Timestamps are CycleClock >> 7 and wrap every 2^36 cycles.

SlowUnlock reported the releasing thread's own acquisition wait, which the
lock-side hook already reports.  Instead, store in lock word bits [31:3] when
the current hold first had a sleeping waiter, and report the elapsed time at
unlock against the holder's stack, like Mutex's unlocking_delay.

The lock word protocol is unchanged: bits [31:3] are written at the same points
and are non-zero under the same conditions.  Holds resolved while waiters spin
are not reported.  Timestamps are CycleClock >> 7 and wrap every 2^36 cycles.

PiperOrigin-RevId: 1012337367
@copybara-service
copybara-service Bot merged commit 1dc74f6 into master Nov 2, 2026
@copybara-service
copybara-service Bot deleted the test_991641114 branch November 2, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant