STRUCT POWER_ALLOCATOR_PARAMS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct power_allocator_params(9) β€” like, the whole vibe ✨

okay so this is a page straight out of the Kernel API Manual, bestie, and we're talking about struct power_allocator_params β€” the parameters for the power allocator governor πŸŽ€. yes, THAT governor. the one that keeps your thermal zone from ✨spiraling✨. let's get into it, no cap.


🌸 NAME 🌸

struct power_allocator_params β€” parameters for the power allocator governor. that's it, that's the whole name, and honestly? iconic. πŸ‘‘


✨ SYNOPSIS ✨

here's the struct in all its glory, copied character for character because we do NOT play with code integrity:

struct power_allocator_params {
    bool allocated_tzp;
    bool update_cdevs;
    s64 err_integral;
    s32 prev_err;
    u32 sustainable_power;
    const struct thermal_trip *trip_switch_on;
    const struct thermal_trip *trip_max;
    int total_weight;
    unsigned int num_actors;
    unsigned int buffer_size;
    struct power_actor *power;
 };

look at her. eleven fields. main character energy fr fr πŸ¦‹.


🫢 Members 🫢

okay bestie, field by field, let's go β€” every single one, i'm not skipping a thing:

  • allocated_tzp β€” a bool that tells you whether we have allocated tzp for this thermal zone and it needs to be freed on unbind. so like, if this is true, somebody's gotta clean up on the way out. no leaving your mess in the thermal zone, periodt πŸ’….
  • update_cdevs β€” another bool: whether or not we update cdevs on the next run. that's the whole thing. short and sweet, we love a low-effort king.
  • err_integral β€” an s64 holding the accumulated error in the PID controller. the receipts of every error you've ever made, babes. it just keeps adding up 😭.
  • prev_err β€” an s32, the error from the previous iteration of the PID controller. and the tea? it's used to calculate the derivative term. it's giving "i remember what you did last time" πŸ™ˆ.
  • sustainable_power β€” a u32: the sustainable power (heat) that this thermal zone can dissipate. like, how much heat she can handle before things get messy πŸ”₯. know your limits, queen.
  • trip_switch_on β€” a const struct thermal_trip * pointing at the first passive trip point of the thermal zone. the governor switches on when this trip point is crossed. heads up tho, real talk: if the thermal zone only has one passive trip point, trip_switch_on should be NULL. that's a literal requirement, not a suggestion, so don't come for me πŸŽ€.
  • trip_max β€” a const struct thermal_trip * to the last passive trip point of the thermal zone. this is the temperature we are controlling for. the final boss. the temperature we're literally obsessed with hitting πŸ‘‘.
  • total_weight β€” an int: the sum of all thermal instances weights. math! adding! we love to see it ✨.
  • num_actors β€” an unsigned int: the number of cooling devices supporting IPA callbacks. counting your little actors, one by one, like the little stars they are ⭐.
  • buffer_size β€” an unsigned int: the internal buffer size, there to avoid runtime re-calculation. aka the "we already did this math, bestie, we're not doing it again" field πŸ’€.
  • power β€” a struct power_actor *: the buffer for all power actors' internal power information. all the power, all the info, all in one place 🌈.

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, i'm literally begging you β€” the kernel file ./drivers/thermal/gov_power_allocator.c plus mul_frac(9), div_frac(9), struct power_actor(9), estimate_sustainable_power(9), estimate_pid_constants(9), get_sustainable_power(9), pid_controller(9), power_actor_set_power(9), divvy_up_power(9), get_governor_trips(9), check_power_actors(9), and power_allocator_bind(9). that's the whole reading list, don't skip a single one, iykyk πŸ“šπŸ’–


and that's the page!! mwah πŸ’‹ before you go β€” this little gem lives over in ./drivers/thermal, and it's dated October 2026, so like... mark your calendar, future bestie πŸ—“οΈβœ¨. stay thermal, stay sustainable, slay πŸ§šπŸ’œ

πŸ“¦ where this page comes from