sched/idle: Prevent pointless NOHZ transitions in default_idle_call()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 20 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | sched/idle: Make default_idle_call() staticinclude/ kernel/ | +1 | 0 replies | |
| 2/2 | sched/idle: Make default_idle_call() NOHZ awarekernel/ | +57 | 26 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Christian Loehle | Aboorva Devarajan | Frederic Weisbecker |
|---|---|---|---|
| 1/2 | |||
| 2/2 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [patch 0/2] sched/idle: Prevent pointless NOHZ transitions in default_idle_call()
default_idle_call() is used when cpuidle is not available. That's the case on most virtual machines.
It unconditionally tries to transition to NOHZ idle mode on every invocation, which allows the hypervisor to go into long idle sleeps.
But that's counterproductive on a loaded system where CPUs go briefly idle for a couple of microseconds. That causes to reprogram the clock event device twice, one on entry and then when leaving idle a few microseconds later. That's especially hurtful for VMs as programming the clock event device implies a VM exit.
See also the related discussion here:
https://lore.kernel.org/875x7mv8wd.ffs@tglx
Cure this by implementing a moving average tracking idle time in default_idle_call() and only stop the tick when the resulting average idle time is larger than a tick.
The series applies on v7.0-rc1.
Thanks,
tglx
--- include/linux/cpuidle.h | 1 kernel/sched/idle.c | 65 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 9 deletions(-)