Repository navigation
Size SpinLock and Mutex spin time limits to machine capacity. - #2419
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_1009321328
branch
2 times, most recently
from
November 3, 2026 01:49
1c418fb to
0c546c3
Compare
copybara-service
Bot
force-pushed
the
test_1009321328
branch
from
November 3, 2026 01:57
0c546c3 to
c1ae629
Compare
copybara-service
Bot
force-pushed
the
test_1009321328
branch
5 times, most recently
from
November 3, 2026 06:05
fbad92e to
00afd4b
Compare
Fixed spin-loop iteration counts spend 2–4× more wall-clock time on slower CPUs than on faster ones. In fleet experiments, longer fixed-iteration spins improved performance smaller and mid-size machines, but regressed performance on the highest-capacity machines, where packed work appears to scale with machine GCU capacity. Bound contended `SpinLock` and exclusive `absl::Mutex` spinning by a shared process-wide time limit T = min(5 µs, 1.4 µs × 250 / (g × N)), inversely proportional to machine compute capacity. Estimate per-CPU speed g via an integer-latency probe (4 readings per calibration, latching the fastest reading seen by the process) and refresh T on failed lock() slow paths before wait timestamps are recorded, at intervals doubling from 10 ms to 10 s. PiperOrigin-RevId: 1009321328
copybara-service
Bot
force-pushed
the
test_1009321328
branch
from
November 3, 2026 06:36
00afd4b to
3a491d7
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.
Size SpinLock and Mutex spin time limits to machine capacity.
Fixed spin-loop iteration counts spend 2–4× more wall-clock time on slower CPUs than on faster ones. In fleet experiments, longer fixed-iteration spins improved performance smaller and mid-size machines, but regressed performance on the highest-capacity machines, where packed work appears to scale with machine GCU capacity.
Bound contended
SpinLockand exclusiveabsl::Mutexspinning by a shared process-wide time limit T = min(5 µs, 1.4 µs × 250 / (g × N)), inversely proportional to machine compute capacity. Estimate per-CPU speed g via an integer-latency probe (4 readings per calibration, latching the fastest reading seen by the process) and refresh T on failed lock() slow paths before wait timestamps are recorded, at intervals doubling from 10 ms to 10 s.