Linux 7.1 Set to Enable HRTICK Timer by Default After Major Performance Optimizations
#Infrastructure

Linux 7.1 Set to Enable HRTICK Timer by Default After Major Performance Optimizations

Hardware Reporter
2 min read

Linux 7.1 will enable the high-resolution HRTICK timer by default after developers reduced its overhead by 96%, cutting clockevent reprogramming from 2,500 to 100 cycles per second.

Linux 7.1 is poised to bring a significant scheduler improvement that will enable the high-resolution HRTICK timer by default, thanks to a comprehensive optimization effort led by Thomas Gleixner and Peter Zijlstra. The HRTICK timer, part of the scheduler code, leverages high-precision hardware timers instead of the traditional lower-frequency system tick, offering better system responsiveness and reduced latency.

The HRTICK Challenge

The HRTICK timer has long been disabled by default due to its overhead. Gleixner explained that the hrtick deadline changes on every context switch and is also modified by wakeups and balancing operations. On a typical hackbench run, this resulted in approximately 2,500 clockevent reprogramming cycles per second. In virtualized environments, this overhead is particularly problematic as accessing the clockevent device implies a VM-Exit, significantly impacting performance.

The Optimization Breakthrough

The optimization effort consists of 48 patches that fundamentally restructure how the HRTICK timer interacts with the system's clock event infrastructure. The key improvements include:

  • Reduced reprogramming frequency: From ~2,500 cycles per second down to ~100 cycles per second
  • Lower spurious interrupt ratio: Approximately 25% spurious hrtimer interrupts
  • No performance regressions: With all modifications in place, enabling HRTICK no longer results in performance regressions compared to the disabled mode

Benchmark Results

The optimizations show particularly impressive results in specific workloads. Using the command line parameters -l$LOOPS -p -s8 (which uses pipes with a message size of 8 bytes), the improvements are dramatic:

Configuration Runtime Improvement
NO HRTICK[_DL] 0.840s -
HRTICK[_DL] 0.481s ~-42%

For message sizes up to 256 bytes, HRTICK still provides improvements, though not to the same magnitude. The developers note they haven't yet investigated the cause of the particularly large improvement with 8-byte messages.

Technical Impact

The HRTICK timer is crucial for systems requiring high-precision timing and low latency. By enabling it by default, Linux 7.1 will provide better responsiveness for interactive workloads, real-time applications, and virtualized environments without the previous performance penalties.

Timeline and Availability

The patches have been queued in the tip/tip.git repository's sched/hrtick branch, indicating they are ready for integration. With this milestone achieved, the changes are expected to be submitted during the Linux 7.1 merge window in April 2026.

The optimization represents a significant advancement in Linux scheduler efficiency, demonstrating how careful analysis and targeted improvements can unlock features previously deemed too expensive for default use. System administrators and developers can look forward to improved performance and responsiveness in Linux 7.1 without needing to manually enable the HRTICK timer.

Comments

Loading comments...