You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CA-414627: increase polling duration for tapdisk (#6611)
Polling mode is a performance optimization in tapdisk, where it would
busy poll the PV ring for the next request, instead of going to sleep
and waiting for an event channel to wake it up when the next request
arrives. When the guest supplies us with a steady sequence of IO
requests this is quicker (it avoids a lot of syscalls), at the expense
of consuming more Dom0 CPU.
Once polling mode is entered if there are no requests for
polling-duration microseconds, then polling mode is exited.
The wakeup granularity is 4ms on the 4.19 kernel (which also matches
CONFIG_HZ=250).
The default polling duration is 1ms, but we may not be able to reliably
handle such low timeouts.
On newer kernels we seem to hit the 1ms polling duration timeout all the
time, which results in tapdisk entering and exiting polling mode very
often. This is in fact a lot slower than just staying in event mode, or
permanently staying in polling mode when measured with a Phoronix SQLite
benchmark.
Testing showed that a 6ms value results in good benchmark results (~40%
faster than the default event based), and a 3ms value in bad benchmark
results (50% slower than event based).
Increase the default polling duration to be a multiple of the wakeup
granularity on 4.19, which should work with both 4.19 kernels and newer.
Eventually we should measure what is the optimal value where the
overhead of entering/exiting polling mode is no longer greater than
staying in event mode. (This is similar to how entering and exiting C
modes need to take into account enter and latencies, except in this case
those latencies are not known).
0 commit comments