Repository navigation
Fix # of unpurged pages in decay algorithm. - #845
Merged
Merged
Conversation
interwq
commented
May 22, 2017
| nstime_t before_sleep; | ||
| nstime_init2(&before_sleep, tv.tv_sec, tv.tv_usec * 1000); | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Will rebase to fix this.
Contributor
Author
|
Only last commit is relevant here. This is on top of #714. |
jasone
reviewed
May 22, 2017
| if (ndirty > decay->peak_npages) { | ||
| decay->peak_npages = ndirty; | ||
| } | ||
| assert(decay->peak_npages >= |
Member
There was a problem hiding this comment.
This seems like an unnecessarily weak assertion. Can we change peak_npages to be a ceiling, so that the assertion is relevant more of the time?
if (config_debug) {
if (ndirty > decay->ceil_npages) {
decay->ceil_npages = ndirty;
}
size_t npages_limit =
arena_decay_backlog_npages_limit(decay);
assert(decay->ceil_npages >= npages_limit);
if (decay->ceil_npages > npages_limit) {
decay->ceil_npages = npages_limit;
}
}
Contributor
Author
There was a problem hiding this comment.
Good point. Will change.
| * machinery correctness. | ||
| */ | ||
| decay->nunpurged = extents_npages_get(extents); | ||
| decay->nunpurged = npages_limit > current_npages ? npages_limit : |
Member
There was a problem hiding this comment.
Parentheses around the conditional help readability.
jasone
approved these changes
May 23, 2017
When # of dirty pages move below npages_limit (e.g. they are reused), we should not lower number of unpurged pages because that would cause the reused pages to be double counted in the backlog (as a result, decay happen slower than it should). Instead, set number of unpurged to the greater of current npages and npages_limit. Added an assertion: the ceiling # of pages should be greater than npages_limit.
Contributor
Author
|
All tests passed previously. Landing. |
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.
When # of dirty pages move below npages_limit (e.g. they are reused), we should
not lower number of unpurged pages because that would cause the reused pages to
be double counted in the backlog (as a result, decay happen slower than it
should). Instead, set number of unpurged to the greater of current npages and
npages_limit.
Added an assertion: peak # of pages should be greater than npages_limit.
This resolves #813.