cpufreq_update_util(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ‘‘


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