em_dev_compute_costs(9)
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 β .
Return0on success, or a proper error in case of failure. No guessing, bestie β0means slay, and an error means something went sideways π.
π₯ SEE ALSO π₯
- Kernel file
./kernel/power/energy_model.c em_table_free(9)em_table_alloc(9)em_dev_update_perf_domain(9)em_pd_get(9)em_cpu_get(9)em_dev_register_perf_domain(9)em_dev_register_pd_no_update(9)em_dev_unregister_perf_domain(9)em_adjust_cpu_capacity(9)em_dev_update_chip_binning(9)em_update_performance_limits(9)
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
- 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