Repository navigation
Report the contended hold duration from SpinLock::SlowUnlock. - #2415
Merged
Merged
Conversation
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
Bot
force-pushed
the
test_991641114
branch
from
November 2, 2026 19:53
2359609 to
1dc74f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.