Skip to content

cpuidle: governor: Modify the handling of stopped tick

Rafael J. Wysocki linux-pm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v12 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2cpuidle: governors: menu: Refine stopped tick handlingdrivers/cpuidle/governors/gov.h drivers/cpuidle/governors/menu.c+14 -62 replies
2/2cpuidle: governors: teo: Rearrange stopped tick handlingdrivers/cpuidle/governors/teo.c+34 -471 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchChristian LoehleIonut Nechita
1/2R-b T-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] cpuidle: governor: Modify the handling of stopped tick

Hi All,

This is an update of

https://lore.kernel.org/linux-pm/[email protected]/

that fixes an issue in the second patch. The first patch does not change and the changelog below still applies.

When I was thinking about possible ways to address high CPU wakeup latency on isolated CPUs resulting from the selection of deep idle states by cpuidle governors, it occurred to me that it is not always necessary to select a deep idle state if the scheduler tick has been stopped. Namely, if a timer is going to trigger (relatively) shortly, a shallow state may as well be selected because the timer will kick the CPU out of that state anyway and getting stuck in it for a long time is not a concern.

Changing the menu governor to take that observation into account is a 2-line patch, modulo a comment update (patch [1/2]). Of course, the SAFE_TIMER_RANGE_NS value is somewhat arbitrary.

Updating the teo governor accordingly is a bit more challenging, but overall it is a major simplification of the stopped tick handling there, so IMV it is very much worth doing (patch [2/2]).

By itself, this is not going to help workloads running on isolated CPUs too much, but if SAFE_TIMER_RANGE_NS were replaced with a per-CPU tunable, that could help people to configure their systems to avoid the latency issue mentioned above.

Thanks,
Rafael