Skip to content

RFC tick/nohz: Add per-CPU control of non-idle tick suppression

Peng Wang cgroups driver-core linux-api linux-trace-kernel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest2 patches 8 repliesIn review
  2. v1 RFC2 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- Following Greg's sysfs feedback [1], replace the global CPU list with a per-CPU boolean, removing the list-size and custom parsing issues.
- Rename nohz_full_allowed to nohz_tick_allowed, as suggested by Waiman.
- Explain the vCPU allocation use case and clarify permission semantics.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tick/nohz: Add a policy dependency for full dynticksinclude/linux/tick.h include/trace/events/timer.h kernel/time/tick-sched.c+50 -38 replies
2/2cpu: Add per-CPU control of non-idle tick suppressionDocumentation/ABI/testing/sysfs-devices-system-cpu drivers/base/cpu.c+80 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/2] tick/nohz: Add per-CPU control of non-idle tick suppression

This series adds per-CPU control of non-idle tick suppression within the boot-time nohz_full set. The policy can be changed without taking CPUs offline.

Some cloud hosts pin vCPU threads one-to-one to host CPUs. At full allocation, housekeeping CPUs also provide vCPU capacity and always retain their non-idle tick. Operators want comparable performance for otherwise equivalent vCPUs, regardless of CPU placement. Retaining the non-idle tick on nohz_full CPUs as well avoids one placement-dependent difference in host tick interference.

With spare capacity, selected nohz_full CPUs may stop the tick to reduce host scheduler-tick interference with vCPUs. Allocation changes as VMs are created or destroyed while other VMs remain running. A vCPU thread may be the only runnable task in either state, so existing tick dependencies do not express this policy.

The per-CPU nohz_tick_allowed boolean defaults to 1 (allowed). Writing 0 prevents non-idle tick suppression; writing 1 allows it, subject to existing dependencies. Readback reports permission, not tick state. This leaves idle tick suppression, nohz_full membership, context tracking, RCU offloading and housekeeping configuration unchanged.

This series depends on the separately submitted nohz kick fix [2]. Testing used that fix together with this series in x86_64 KVM guests, with NO_HZ_FULL enabled and disabled.

Changes since v1:
- Following Greg's sysfs feedback [1], replace the global CPU list with a per-CPU boolean, removing the list-size and custom parsing issues.
- Rename nohz_full_allowed to nohz_tick_allowed, as suggested by Waiman.
- Explain the vCPU allocation use case and clarify permission semantics.

v1: https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/2026101743-monotype-demeaning-f97b@gregkh/
[2] "tick/nohz: Requeue kicks flushed outside hardirq context"

    Message-ID: <43668cf88d976084e2865ec07dea82b64ad402ba.1792240863.git.peng_wang@linux.alibaba.com>

Peng Wang (2):
tick/nohz: Add a policy dependency for full dynticks
cpu: Add per-CPU control of non-idle tick suppression

 .../ABI/testing/sysfs-devices-system-cpu      | 27 ++++++++++
 drivers/base/cpu.c                            | 53 +++++++++++++++++++
 include/linux/tick.h                          |  8 ++-
 include/trace/events/timer.h                  |  3 +-
 kernel/time/tick-sched.c                      | 42 +++++++++++++++
 5 files changed, 130 insertions(+), 3 deletions(-)

base-commit: 70dd4ee72eb2d5793c62e71c14e3aba78e5a4e56
prerequisite-patch-id: 6036ece815f0ab92a0413d433675d5b240b7a8c1

Signature · 1 line
2.47.0