Avoid blocking on background thread lock for stats.#1510
Merged
interwq merged 1 commit intojemalloc:devfrom May 22, 2019
Merged
Avoid blocking on background thread lock for stats.#1510interwq merged 1 commit intojemalloc:devfrom
interwq merged 1 commit intojemalloc:devfrom
Conversation
Background threads may run for a long time, especially when the # of dirty pages is high. Avoid blocking stats calls because of this (which may cause latency spikes).
yinan1048576
approved these changes
May 22, 2019
Contributor
yinan1048576
left a comment
There was a problem hiding this comment.
Looks great! One nit - see below.
| * Each background thread run may take a long time; | ||
| * avoid waiting on the stats if the thread is active. | ||
| */ | ||
| continue; |
Contributor
There was a problem hiding this comment.
Do you want to have a counter or something so that the caller can know how many background threads succeeded? E.g. instead of returning a bool, return an unsigned counter so that the caller can know more details if desired? May not be immediately useful though given the current way this function is called.
Contributor
Author
There was a problem hiding this comment.
Yep it could be useful if we decide to report detailed per thread stats -- right now only the aggregated numbers are shown.
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.
Background threads may run for a long time, especially when the # of dirty pages
is high. Avoid blocking stats calls because of this (which may cause latency
spikes).
Resolves #1502.