Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reactor: improve task quota timer resolution
Commit 4942016 ("reactor: switch task quota timer to CLOCK_THREAD_CPUTIME_ID") switched the task quota timer to a cputime clock, to avoid counting the time we spend sleeping, as this results in spurious wakes during sleep, and therefore high idle cpu consumption. However, an uninteneded side effect occured since CLOCK_THREAD_CPUTIME_ID has 1/HZ resolution in Linux, rather than being a high resolution timer. With the default configuration, on a Red Hat kernel that doesn't make much of a difference, since HZ=1000 and the task quota is 2 ms. But on Ubuntu kernels (where HZ=250 -> 4ms resolution), or if someone sets --task-quota-ms, we have the task quota timer having lower resolution than the task quota, so we consistently miss it. This hurts latency sensitive loads. To fix this, change back to the high resolution CLOCK_MONOTONIC clock, but disable it while we sleep to avoid spurious wakeups. Message-Id: <[email protected]>
- Loading branch information