{{ message }}
[cache_bin] prefetch refilled pointers and add experimental fast_path_prefetch#2851
Open
spredolac wants to merge 1 commit intojemalloc:devfrom
Open
[cache_bin] prefetch refilled pointers and add experimental fast_path_prefetch#2851spredolac wants to merge 1 commit intojemalloc:devfrom
spredolac wants to merge 1 commit intojemalloc:devfrom
Conversation
e5e0d48 to
0707856
Compare
9373fb8 to
0f2ddf8
Compare
0f2ddf8 to
bcda5c7
Compare
bcda5c7 to
c0e9a8d
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.

This change enables two features which are off by default:
runtime feature which will prefetch up to
nprefetch_cache_fillpointers when cache_bin is refilled (if the next pointer in the bin is on the same cacheline as the one prior to it, it will not be prefetched). On some architectures this may be worth cost to pay when it is expected that those pointers will be return for allocations that will come soon. Default value is 0 and this is not enabled.Build time feature
--enable-experimental-fp-prefetchis added and if enabled it will prefetch the next pointer in the cache_bin when current one is returned to allocation call. To avoid the boundary check, we will pad the cache_bin with one extra space and put the address of that space itself so that prefetch call of the last legit element of the bin still has good address (avoiding larger performance penalty on some platforms)Beyond unit tests, ran it on internal servers and confirmed that performance when both features were disabled was neutral, while when enabled we notice movement of CPU and TLB misses depending on memory allocation traffic patterns.