]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
x86: switch from CONFIG_HZ_PERIODIC to CONFIG_NO_HZ_IDLE 21470/head
authorJohn Audia <therealgraysky@proton.me>
Fri, 9 Jan 2026 13:16:09 +0000 (08:16 -0500)
committerRobert Marko <robimarko@gmail.com>
Fri, 9 Jan 2026 15:35:34 +0000 (16:35 +0100)
Running with CONFIG_HZ_PERIODIC=y keeps the scheduler tick running
continuously, which produces higher jitter and lower power efficiency.
In contrast, CONFIG_NO_HZ_IDLE=y (the upstream default) stops the tick
only when the CPU is idle, giving lower idle power and normal runtime
jitter.

An Intel N150-based router/firewall was tested using two kernel builds:
one with CONFIG_HZ_PERIODIC=y, and one with CONFIG_NO_HZ_IDLE=y. Power
consumption was measured while the system was essentially idle (no
meaningful traffic). The CONFIG_NO_HZ_IDLE=y build consistently used
less power.

Details: The two power-measurement methods were:

 1. PkgWatt from turbostat (software)
 2. Wall-power measurement using a Kill-A-Watt (hardware)

The test began by zeroing the Kill-A-Watt and simultaneously running:
turbostat --quiet --Summary --interval 10 --show Busy%,PkgWatt

The test duration was defined by the time required for the Kill-A-Watt
to accumulate 0.005 kWh, after which the average wattage was calculated.

Results:
+----------------------+-----------------+----------------+-----------+
|  Metric              |   HZ_PERIODIC   |   NO_HZ_IDLE   | Delta %   |
+----------------------+-----------------+----------------+-----------+
|  PkgWatt             |  3.59 ± 0.38    |  3.38 ± 0.34   |  -5.9 %   |
+----------------------+-----------------+----------------+-----------+
| Avg wattage at wall  |      12.47      |     12.00      |  -3.77 %  |
+----------------------+-----------------+----------------+-----------+

The mean PkgWatt difference is 210 mW (5.9%) in favor of
CONFIG_NO_HZ_IDLE=y, with a t-statistic of ~3.17 and p ≈ 0.002.

Wall-power measurements show a 470 mW (3.77%) reduction under
CONFIG_NO_HZ_IDLE=y.

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21470
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/x86/config-6.12

index 5fb0d2885b5b72195790a0f0105fde45e0700e58..581e5a54a5e96db3b0f3ab5e3107ed5861353a39 100644 (file)
@@ -184,7 +184,6 @@ CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_GEODE=y
 CONFIG_HW_RANDOM_VIA=y
 # CONFIG_HYPERVISOR_GUEST is not set
-CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_ALGOBIT=y
 CONFIG_I2C_BOARDINFO=y
@@ -325,6 +324,7 @@ CONFIG_NLS=y
 # CONFIG_NMI_CHECK_CPU is not set
 # CONFIG_NOHIGHMEM is not set
 CONFIG_NO_HZ=y
+CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=1
 CONFIG_NR_CPUS_DEFAULT=1
 CONFIG_NR_CPUS_RANGE_BEGIN=1