divvy_up_power(9)
π divvy_up_power β kernel API manual, bestie edition π
okay so real talk, we're in the divvy_up_power(9) page from the Kernel API Manual, and honestly? it's giving "fair share" energy and i'm obsessed. let's get into it β¨
β¨ NAME β¨
divvy_up_power β divvy the allocated power between the actors π«Ά
like, literally. it's in the name. it divides. it shares. it slays.
πΈ SYNOPSIS πΈ
void divvy_up_power (struct power_actor *power , int num_actors , u32
total_req_power , u32 power_range );
no cap, that's the whole signature. copy it exactly, don't come for me π
π¦ ARGUMENTS π¦
powerβ buffer for all power actors internal power information π this is where each actor's lil internal deets livenum_actorsβ number of power actors in this thermal zone π₯ count 'emtotal_req_powerβ sum of all weighted requested power for all actors π the grand total of everyone's weighted askspower_rangeβ total allocated power π the actual bag we're splitting up
π DESCRIPTION π
okay so here's the vibe: this function divides the total allocated power (power_range) fairly between the actors. fair as in, no main character hogging the whole thing. periodt. π
first pass? it tries to give each actor a share of the power_range according to how much power it requested compared to the rest of the actors. it's proportional, it's cute, it's math. for example:
- if only one actor requests power, then it receives all the
power_rangeπ (lucky them, honestly) - if three actors each requests
1mW, each receives a third of thepower_rangeβοΈ (balanced. iconic. no notes.)
and then the plot twist π«’ β if any actor received more than their maximum power, then that surplus is re-divvied among the actors based on how far they are from their respective maximums. yeah, the leftovers get redistributed. nothing wasted, nothing extra. chef's kiss.
π₯ SEE ALSO π₯
- Kernel file
./drivers/thermal/gov_power_allocator.cπ mul_frac(9)β multiply those fractions bestiediv_frac(9)β divide 'em toostruct power_actor(9)π§struct power_allocator_params(9)βestimate_sustainable_power(9)π±estimate_pid_constants(9)ποΈget_sustainable_power(9)πpid_controller(9)πΉοΈpower_actor_set_power(9)β‘get_governor_trips(9)π¦check_power_actors(9)βpower_allocator_bind(9)π
ngl bestie, if you're touching thermal zone power allocation, read the whole squad above. iykyk π
and that's the page!! π ty for coming to my ted talk, this dropped out of ./drivers/thermal back in October 2026 and it's still serving. mwah πβ¨π
π¦ 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