STRUCT POWER_ALLOCATOR_PARAMS(9)
π 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β aboolthat tells you whether we have allocatedtzpfor 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β anotherbool: 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β ans64holding the accumulated error in the PID controller. the receipts of every error you've ever made, babes. it just keeps adding up π.prev_errβ ans32, 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β au32: 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β aconst 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_onshould beNULL. that's a literal requirement, not a suggestion, so don't come for me π.trip_maxβ aconst 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β anint: the sum of all thermal instances weights. math! adding! we love to see it β¨.num_actorsβ anunsigned int: the number of cooling devices supporting IPA callbacks. counting your little actors, one by one, like the little stars they are β.buffer_sizeβ anunsigned 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β astruct 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
- 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