Remove hpa_sec_batch_fill_extra and calculate nallocs based on misses.#80
Draft
gctony wants to merge 2 commits intofacebook:devfrom
Draft
Remove hpa_sec_batch_fill_extra and calculate nallocs based on misses.#80gctony wants to merge 2 commits intofacebook:devfrom
gctony wants to merge 2 commits intofacebook:devfrom
Conversation
Author
|
I will fix |
658fd45 to
8b65560
Compare
Author
|
A couple of thoughts on this:
|
b8124b1 to
4e8ea45
Compare
Author
|
Updated the max nallocs calculation and I now base it on the sec's |
Author
|
Latest changes:
|
spredolac
reviewed
Mar 11, 2026
src/sec.c
Outdated
|
|
||
| /* Take the number of misses into account. | ||
| As the number of misses goes up, we'll ask for extra nallocs. */ | ||
| size_t nallocs = bin->stats.nmisses; |
There was a problem hiding this comment.
This will only make sense very early on, after that you will always hit the cap.
spredolac
reviewed
Mar 11, 2026
src/sec.c
Outdated
| As the number of misses goes up, we'll ask for extra nallocs. */ | ||
| size_t nallocs = bin->stats.nmisses; | ||
| nallocs = MINIMUM(nallocs, max_nallocs); | ||
| /* defenseive */ |
spredolac
reviewed
Mar 11, 2026
src/sec.c
Outdated
| sec, sec_shard_pick(tsdn, sec), pszind); | ||
|
|
||
| /* Shoot for nallocs that corresponds to max_bytes / 2, but cap it by MAX_NALLOCS. */ | ||
| const size_t max_nallocs = MINIMUM( |
There was a problem hiding this comment.
Could max_bytes be 2 * size? If so this becomes 1?
spredolac
reviewed
Mar 11, 2026
src/sec.c
Outdated
| size_t max_nallocs = 1; | ||
|
|
||
| if (sec_size_supported(sec, size)) { | ||
| /* max is equivalent of 1/3 of max_bytes */ |
Author
There was a problem hiding this comment.
I did and I felt min_nallocs was ending up a bit too small (vs. the current default). But you were right that 1/2 was probably too much. So I decided to split the difference. But I can change it to 1/4.
8994d97 to
e02bfde
Compare
e02bfde to
9c0ad46
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.
Remove bach_fill_extra field (and associated setters) and calculate nallocs based on misses. The more recorded misses, the higher the nallocs number up to a maximum.