cpufreq_update_util(9)
π cpufreq_update_util(9) β like, the Kernel API Manual, bestie π
Okay so picture this: we're deep in the kernel, and there's this one little function whose entire job is to take a note about CPU utilization changes. That's it. That's the whole vibe. It's giving "quiet main character who actually runs everything." β¨
πΈ NAME πΈ
cpufreq_update_util β take a note about CPU utilization changes. π
π¦ SYNOPSIS π¦
void cpufreq_update_util (struct rq *rq , unsigned int flags );
π ARGUMENTS π
rqβ the runqueue you're carrying out the update for. Like, this is the runqueue, bestie, no cap.flagsβ the update reason flags. the "why are we even here" of it all.
β¨ DESCRIPTION β¨
Okay so here's the tea β β this function gets called by the scheduler, on the CPU whose utilization is being updated. That's the whole setup.
π¨ Important vibe check: it can only be called from RCU-sched read-side critical sections. Like, that's not a suggestion, that's the rule. Don't be out here calling it from anywhere else, fr fr. π
Now, the way cpufreq is currently arranged, it needs to evaluate the CPU performance state (that's frequency/voltage, iykyk β‘) on a regular basis, otherwise it can get stuck in a completely inadequate performance level for too long. And that is not guaranteed to happen if the updates are only triggered from CFS and DL β because those updates might just... not be coming in, if only RT tasks are active all the time (or if there are RT tasks only). π
So as a workaround for that whole issue, this function gets called periodically by the RT sched class, to trigger extra cpufreq updates and keep it from stalling. But ngl? That really is a band-aid. π©Ή Going forward it should be replaced with solutions targeted more specifically at RT tasks. Periodt. π
π SEE ALSO π
- Kernel file
./kernel/sched/sched.havailable_idle_cpu(9) - highest_flag_domain(9)
- arch_scale_freq_capacity(9)
and that's a wrap, bestie π«Ά this little icon lives in ./kernel/sched, dated October 2026, and it's cpufreq_update_util(9) all day every day. go forth and update those utilizations ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms