gov_update_cpu_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gov_update_cpu_data πŸ’…

okay so bestie, welcome to the Kernel API Manual entry for gov_update_cpu_data β€” yes, that’s gov_update_cpu_data(9), and it’s lowkey iconic for keeping CPU load data in check ✨

πŸ’• NAME πŸ’•

gov_update_cpu_data β€” Update CPU load data. periodt πŸ’–

✨ SYNOPSIS ✨

void gov_update_cpu_data (struct dbs_data *dbs_data );

πŸŽ€ ARGUMENTS πŸŽ€

  • dbs_data β€” Top-level governor data pointer. the main character pointer, fr fr 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does is update CPU load data for all the CPUs in the domain governed by dbs_data. That domain might be a single policy, or a whole bunch of them if the governor tunables are system-wide 🌈

You gotta call it under dbs_data->attr_set.update_lock. The per-policy update_mutex is acquired and released internally for each policy β€” no cap, it handles that part itself πŸ’…

πŸ’œ NOTE πŸ’œ

prev_cpu_nice is reset here unconditionally, right alongside prev_cpu_idle. When io_is_busy changes, both baselines must be advanced to the same timestamp so that the next dbs_update computes idle_time and nice_delta over the same interval. This prevents an artificially inflated idle_time when ignore_nice_load is enabled πŸ˜­πŸ‘‘

bestie this note is important β€” same timestamp for both baselines, or the idle math gets messy πŸ’€

🌸 SEE ALSO 🌸

  • Kernel file ./drivers/cpufreq/cpufreq_governor.c 🧚

mwah πŸ’‹ sign-off vibes: this page comes from ./drivers/cpufreq, dated October 2026, and yes it’s still gov_update_cpu_data(9) β€” bye bestie, slay responsibly πŸ¦‹πŸ’–

πŸ“¦ where this page comes from