Repository navigation
Conversation
This replaces arena->lock synchronization.
This mildly reduces stats update overhead during normal operation.
This removes the last use of arena->lock.
Member
Author
|
This is going to need some rework, because it uses 64-bit atomic ops, and we don't currently have those on 32-bit platforms. |
Closed
interwq
reviewed
Feb 13, 2017
| do { | ||
| a0 = atomic_read_u64(&arena->prof_accumbytes); | ||
| a1 = a0 + accumbytes; | ||
| overflow = (a1 >= prof_interval); |
Contributor
There was a problem hiding this comment.
Is it possible for accumbytes to be huge? If so this may overflow uint64, in which case the overflow calculation needs to be adjusted.
Member
Author
There was a problem hiding this comment.
prof_interval can be no larger than 2^63, so I don't think arena->prof_accumbytes can overflow in practice.
| a1 = a0 + accumbytes; | ||
| overflow = (a1 >= prof_interval); | ||
| if (overflow) { | ||
| a1 %= prof_interval; |
Contributor
There was a problem hiding this comment.
This implies that we may get 1 sample for multiple of prof_interval bytes. Probably worth mentioning in a comment?
Member
Author
|
I'm going to close this pull request and create a new one once I have a workable strategy for 64-bit stats counters. |
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.
This series of changes refactors out arena->lock, through a combination of atomic operations (especially for stats) and field-specific independent mutexes.
This relates to #466.