All Products
Search
Document Center

Alibaba Cloud Linux:Optimize the operation of reading the /proc/cpuinfo file to obtain the CPU frequency

Last Updated:Apr 01, 2026

When multiple threads or processes concurrently read /proc/cpuinfo for CPU frequency data, the system sends inter-processor interrupt (IPI) requests to all CPU cores. Under high concurrency, these requests accumulate into an IPI storm that degrades system performance. Alibaba Cloud Linux 3 includes a kernel optimization that prevents this IPI storm and reduces unnecessary CPU wake-ups during frequency reads.

Applicability

AttributeValue
Operating systemAlibaba Cloud Linux 3
Kernel version5.10.134-17.al8 and later
Architecturex86

How the optimization works

The optimization addresses the IPI storm through two complementary mechanisms.

Shared cache with atomic exchange

Instead of each thread sending a fresh IPI request, threads share a copy of recently fetched frequency data. An atomic exchange (atomic_xchg()) checks and updates the cached values. The cache is valid for approximately 20 milliseconds. Only after this window expires can a new smp_call_function_single() call fetch updated data. This prevents threads from flooding the same CPU with repeated IPI requests within a short period.

NOHZ handling for idle CPUs

Reading /proc/cpuinfo forces CPUs in the Idle state to wake up by sending IPI requests to them. The wake-up process can cause the CPU frequency to shift, which is determined by the dynamic scheduling algorithm. With the NOHZ feature enabled in Alibaba Cloud Linux 3, idle CPUs return their base frequency values directly without waiting for an IPI request. This eliminates frequency deviations caused by the wake-up transition.

Benefits

  • Reduced IPI traffic: The optimization stops unnecessary IPI requests and avoids waking idle CPUs, which lowers processing overhead.

  • Stable multi-core performance: Fewer interruptions to CPU management activities such as task scheduling result in more consistent system throughput.

Known limitation: apparent CPU frequency reduction

Because idle CPUs return their base frequency rather than their real-time frequency, the values shown in /proc/cpuinfo for idle CPUs are lower than the actual frequency of CPUs in the Idle state. This produces an apparent "frequency reduction" that does not reflect a real performance drop.

To get accurate real-time CPU frequency data, use the turbostat tool or other tools to read the MSR.