-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsnap: busy wait a number of cycles #8073
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-0.19 #8073 +/- ##
============================================
Coverage 82.74% 82.74%
============================================
Files 103 103
Lines 17702 17702
============================================
Hits 14648 14648
Misses 3054 3054 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions. Otherwise looks fine.
@@ -280,7 +291,7 @@ __device__ void snappy_decode_symbols(unsnap_state_s *s, uint32_t t) | |||
if (t == 0) { | |||
s->q.prefetch_rdpos = cur; | |||
#pragma unroll(1) // We don't want unrolling here | |||
while (s->q.prefetch_wrpos < min(cur + 5 * batch_size, end)) {} | |||
while (s->q.prefetch_wrpos < min(cur + 5 * batch_size, end)) { busy_wait(10); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 10 in some places and 20 in others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original times in nanoseconds were 50 or 100. I noticed a significant perf regression when using the same number of cycles (compared to no waits). Divided all wait cycles by 5 and got great perf results. Went with this to make the PR available for testing ASAP.
In short, the numbers are not carefully chosen, I'm open to suggestions on the values to use here.
Co-authored-by: Mark Harris <[email protected]>
Busy replacement for
nanosleep
.