reactor: Disable hot polling if wakeup granularity is too high #2715
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 are seeing an issue where rand write performance under performs
massively (100x).
This is caused by the linux dio kernel thread/workqueue being starved
and hence aio write completitions aren't being served in a timely
manner.
This doesn't happen using "default" linux settings but only if
/proc/sys/kernel/sched_wakeup_granularity_ns
or(
/sys/kernel/debug/sched/wakeup_granularity_ns
on newer kernels) israised.
Specifically this effect can be observed on RHEL-8 as the
tuned
version that ships with it sets this value to 15000000 but can
reproduced on any other system by just bumping that value.
This patch tries to detect this being the case and if so it will warn
and disable hot polling (both
--poll-aio
and--idle-poll-time-us
)which gives back the majority of the performance.
Note because this setting has moved to debug fs on newer kernels which
requires root rights to read it's actually not very likely that we will
be able to detect it on these. However, RHEL8 uses an older kernel and
is likely the major offender to run into this bug (we have had multiple
customers run into this).
Ref #2696