public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/2] sched/idle: Prevent pointless NOHZ transitions in default_idle_call()
@ 2026-03-01 19:30 Thomas Gleixner
  2026-03-01 19:30 ` [patch 1/2] sched/idle: Make default_idle_call() static Thomas Gleixner
  2026-03-01 19:30 ` [patch 2/2] sched/idle: Make default_idle_call() NOHZ aware Thomas Gleixner
  0 siblings, 2 replies; 29+ messages in thread
From: Thomas Gleixner @ 2026-03-01 19:30 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Rafael J. Wysocki, Frederic Weisbecker,
	Christian Loehle

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(-)



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2026-03-10 15:14 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01 19:30 [patch 0/2] sched/idle: Prevent pointless NOHZ transitions in default_idle_call() Thomas Gleixner
2026-03-01 19:30 ` [patch 1/2] sched/idle: Make default_idle_call() static Thomas Gleixner
2026-03-01 19:30 ` [patch 2/2] sched/idle: Make default_idle_call() NOHZ aware Thomas Gleixner
2026-03-02  6:05   ` K Prateek Nayak
2026-03-02 10:43   ` Frederic Weisbecker
2026-03-02 11:03     ` Christian Loehle
2026-03-02 11:11       ` Frederic Weisbecker
2026-03-02 11:39         ` Christian Loehle
2026-03-04  3:35           ` Qais Yousef
2026-03-02 11:03   ` Christian Loehle
2026-03-02 21:25     ` Rafael J. Wysocki
2026-03-04  3:03       ` Qais Yousef
2026-03-06 21:21         ` Rafael J. Wysocki
2026-03-06 21:31           ` Rafael J. Wysocki
2026-03-07 16:25             ` Rafael J. Wysocki
2026-03-10  3:54               ` Qais Yousef
2026-03-10  9:18                 ` Christian Loehle
2026-03-10 15:03                   ` Qais Yousef
2026-03-10 15:09                     ` Rafael J. Wysocki
2026-03-10 15:14                       ` Qais Yousef
2026-03-07 16:12         ` [PATCH v1] sched: idle: Make skipping governor callbacks more consistent Rafael J. Wysocki
2026-03-09  9:13           ` Christian Loehle
2026-03-09 12:26             ` Rafael J. Wysocki
2026-03-10  3:57               ` Qais Yousef
2026-03-09 12:44           ` Aboorva Devarajan
2026-03-10 14:28           ` Frederic Weisbecker
2026-03-02 12:17   ` [patch 2/2] sched/idle: Make default_idle_call() NOHZ aware Peter Zijlstra
2026-03-02 12:19     ` Peter Zijlstra
2026-03-02 21:23       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox