DISPATCH-1295 - Reduce lock contention and make fewer system calls.#476
Closed
cliffjansen wants to merge 1 commit intoapache:masterfrom
Closed
DISPATCH-1295 - Reduce lock contention and make fewer system calls.#476cliffjansen wants to merge 1 commit intoapache:masterfrom
cliffjansen wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #476 +/- ##
==========================================
+ Coverage 86.97% 87.09% +0.12%
==========================================
Files 86 86
Lines 19281 19332 +51
==========================================
+ Hits 16770 16838 +68
+ Misses 2511 2494 -17
Continue to review full report at Codecov.
|
Author
|
Since this pull request builds on top of DISPATCH-1274, and that has been removed for the next release, I am closing this for now. Next steps TBD. |
ChugR
pushed a commit
to ChugR/qpid-dispatch
that referenced
this pull request
Oct 13, 2022
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.
Flamegraphs show on a single quiver run that there is lock contention in setting timers. Locks are held across system calls and also cause thread stalls as seen in offcpu runs.
This change restricts the main timer lock to updating internal data structures. A second lock is used to prevent setting timer values out of order.
The main benefit is that immediate timer calls have much less contention with non-immediate timers.
Using a standard quiver C client run of 9,000,000 message, which lasts about a minute, we get 19% of the offcpu related to qd_timer_schedule and qd_timer_visit. This drops to 0 with the change.
Regular on-cpu profiling samples in qd_timer drop from 9.1% of samples to 0.2%. Samples in qd_immediate drop modestly from 0.6% to 0.5%.