-
Notifications
You must be signed in to change notification settings - Fork 165
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
Timer adds a surprising amount of delay vs thread::sleep #652
Comments
Instrumenting the code, I see One potential thing I'm investigating is whether the preemption timer is fighting with the user timer since they both clobber the same Source in uring.rs ( |
No that was a dead end. I did write a very simple program to verify that io_uring by itself does indeed wake up within the 10ms requested. I instrumented a bunch of stuff within glommio and as best I can tell the sys_membarrier sycall is the thing that's taking all that time. If I switch to the mprotect or fallback strategy, the timers complete normally. |
Ok. Thankfully it's much simpler. This only happens on the first timer because it takes that long to register the membarrier when you have more than 1 thread & all Rust tests have 2 threads. Given that the strategy is almost certainly going to be used, I feel like we should front-load that when we construct the executor in the first place to avoid this latency. |
For the following test case I see
std::thread::sleep
take ~11ms butTimer
can take up to 40+ms. That's a surprising amount of added latency and I don't see anything in the docs calling this out as intended behavior so figured I'd file a bug while I investigate.The text was updated successfully, but these errors were encountered: