em_dev_compute_costs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

em_dev_compute_costs(9) πŸ’…βœ¨

okay so bestie, this one comes from the Kernel API Manual, and it’s giving β€œkernel energy model cost-crunching era” πŸ”₯. We’re talking about em_dev_compute_costs, and yes, it’s exactly as iconic as it sounds.


✨ NAME ✨

em_dev_compute_costs β€” calculate the cost values for a new runtime EM table, no cap πŸ’–


🌸 SYNOPSIS 🌸

int em_dev_compute_costs (struct device *dev , struct em_perf_state
       *table , int nr_states );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device for which the EM table is to be updated 🫢
  • table β€” the new EM table that is going to get the costs calculated ✨
  • nr_states β€” number of performance states, i.e. how many states we’re working with πŸ’…

πŸ’– DESCRIPTION πŸ’–

okay so what this function does is calculate the em_perf_state::cost values for a new runtime EM table. Those values are used for EAS during task placement β€” literally main character energy for scheduling 🌈.

It also calculates and sets the efficiency flag for each performance state. So every performance state gets its little efficiency moment, periodt πŸ’….

When the function finishes successfully, the EM table is ready to be updated and used by EAS. That’s the vibe check passing βœ….

Return 0 on success, or a proper error in case of failure. No guessing, bestie β€” 0 means slay, and an error means something went sideways 😭.

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ this page lives under ./kernel/power, dated October 2026, and it’s em_dev_compute_costs(9) signing off 🫢✨

πŸ“¦ where this page comes from