divvy_up_power(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 live
  • num_actors β€” number of power actors in this thermal zone πŸ”₯ count 'em
  • total_req_power β€” sum of all weighted requested power for all actors 🌈 the grand total of everyone's weighted asks
  • power_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 the power_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 πŸ”₯


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