This repository was archived by the owner on Jul 15, 2023. It is now read-only.
fix pointer-chasing to touch full working set #17
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.
We (@jkehne and @mhillenbrand) found an issue in how X-Mem generates its pointer array for pointer-chasing micro-benchmarks. Most of the time, the traversed linked list does not cover the complete pointer array (only ~45% on average). Thus, the actual working set for random access patterns may be less than specified using -w. With the proposed fix, we ensure that the pointer chain walks across the full array (i.e., the pointers form a hamiltonian cycle) at minimum overhead (~4% slowdown in generating the permutation).
A test harness illustrates that the cycles generated by xmem::build_random_pointer_permutation most often miss significant parts of the pointer array. The code measures the actual length of the pointer cycle in the generated pointer array, comparing the original version of xmem::build_random_pointer_permutation and our proposed alternative.
This pull request replaces the existing implementation with our proposed alternative generator.
Please see the commit message below for more details.