Skip to content

Report SpinLock contention from the acquiring thread as well. - #1430

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_984216001
Draft

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_984216001

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 19, 2026

Copy link
Copy Markdown

Report SpinLock contention from the acquiring thread as well.

SpinLock contention was only observable from the releasing side:
SpinLock::SlowUnlock reports the releaser's own quantized acquisition wait via
RegisterSpinLockProfiler, so the stack that actually waited was never
recorded. Add RegisterSpinLockLockProfiler, invoked at the end of
SpinLock::SlowLock on the acquiring thread while it holds the lock, with the
full-precision wait in cycles. This parallels absl::Mutex, which reports
contention from both the lock and unlock paths.

SpinLock contention was only observable from the releasing side:
SpinLock::SlowUnlock reports the releaser's own quantized acquisition wait via
RegisterSpinLockProfiler, so the stack that actually waited was never
recorded.  Add RegisterSpinLockLockProfiler, invoked at the end of
SpinLock::SlowLock on the acquiring thread while it holds the lock, with the
full-precision wait in cycles.  This parallels absl::Mutex, which reports
contention from both the lock and unlock paths.
PiperOrigin-RevId: 984216001
@copybara-service copybara-service Bot changed the title Internal cleanup Report SpinLock contention from the acquiring thread as well. Sep 20, 2026
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