Fix 32-bit count wrap in chase counter#55
Open
Alexandre425 wants to merge 1 commit into
Open
Conversation
The per-thread chase counter was (32-bit), which wraps at 2^32 iterations. At high throughputs (>69 GB/s in a 500 ms sample) the counter wraps once or more, making the fastest pointer-chase runs report inflated latency. Change the field to 'uint64_t', eliminating wrap on any realistic measurement window. multiload.c already had this fix (volatile uint64_t count).
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
The per-thread chase counter was (32-bit), which wraps at 2^32 iterations. At high throughputs (>69 GB/s in a 500 ms sample) the counter wraps once or more, making the fastest pointer-chase runs report inflated latency.
Change the field to
uint64_t, eliminating wrap on any realistic measurement window.multiload.calready had this fix (volatile uint64_t count).Results (Ryzen 7 7735HS, 1 thread, parallel10)
Below is the effective, core-centric bandwidth for a sweep across memory sizes, assuming bandwidth = 8 bytes / average latency (the value reported by
multichase)Before
Note the low reported performance in the L1, where the bandwidth is the highest, and where the counter overflows. The reported performance immediately shoots up when bandwidth drops below the overflow threshold.
After: