Skip to content

thermal: core: Redesign the governor interface

Rafael J. Wysocki linux-pm lkml 1 version In review

Get series with b4
b4 am 13515747.uLZWGnKmhe@kreacher

Versions newest first

  1. v1 Latest16 patches 36 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16thermal: core: Introduce .trip_crossed() callback for thermal governorsdrivers/thermal/thermal_core.c drivers/thermal/thermal_core.h+21 -24 replies
2/16thermal: gov_bang_bang: Use .trip_crossed() instead of .throttle()drivers/thermal/gov_bang_bang.c+13 -182 replies
3/16thermal: gov_bang_bang: Clean up thermal_zone_trip_update()drivers/thermal/gov_bang_bang.c+6 -132 replies
4/16thermal: gov_bang_bang: Fold thermal_zone_trip_update() into its callerdrivers/thermal/gov_bang_bang.c+33 -422 replies
5/16thermal: core: Introduce .manage() callback for thermal governorsdrivers/thermal/thermal_core.c drivers/thermal/thermal_core.h+5 -02 replies
6/16thermal: gov_power_allocator: Use .manage() callback instead of .throttle()drivers/thermal/gov_power_allocator.c+7 -171 reply
7/16thermal: gov_power_allocator: Eliminate a redundant variabledrivers/thermal/gov_power_allocator.c+3 -66 replies
8/16thermal: gov_step_wise: Use .manage() callback instead of .throttle()drivers/thermal/gov_step_wise.c+21 -182 replies
9/16thermal: gov_step_wise: Use trip thresholds instead of trip temperaturesdrivers/thermal/gov_step_wise.c+5 -42 replies
10/16thermal: gov_step_wise: Clean up thermal_zone_trip_update()drivers/thermal/gov_step_wise.c+7 -61 reply
11/16thermal: gov_fair_share: Use .manage() callback instead of .throttle()drivers/thermal/gov_fair_share.c+26 -111 reply
12/16thermal: gov_fair_share: Use trip thresholds instead of trip temperaturesdrivers/thermal/gov_fair_share.c+6 -81 reply
13/16thermal: gov_fair_share: Eliminate unnecessary integer divisionsdrivers/thermal/gov_fair_share.c+15 -171 reply
14/16thermal: gov_user_space: Use .trip_crossed() instead of .throttle()drivers/thermal/gov_user_space.c+5 -55 replies
15/16thermal: core: Drop the .throttle() governor callbackdrivers/thermal/thermal_core.c drivers/thermal/thermal_core.h+0 -152 replies
16/16thermal: core: Relocate critical and hot trip handlingdrivers/thermal/thermal_core.c+4 -72 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchLukasz LubaDaniel Lezcano
1/16R-b
2/16R-b A-b
3/16R-b A-b
4/16R-b A-b
5/16R-b A-b
6/16R-b
7/16R-b
8/16R-b A-b
9/16R-b A-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16R-b A-b
15/16R-b A-b
16/16R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 00/16] thermal: core: Redesign the governor interface

Hi Everyone,

First off, apologies for the size of the series, but I couldn't resist throwing a few cleanups in for a good measure.

To the point, this is based on two observations: (1) that the existing .throttle() governor callback is not really suitable or convenient for any governors in the tree and (2) that the majority of governors in the tree do not take trip hysteresis into account, although arguably they should do that.

Point (1) is addressed by replacing the .throttle() callbacks with two new governor callbacks, .trip_crossed() and .manage().

The first one will be invoked whenever a trip is crossed at the time when the netlink messages are sent (so the ordering of these calls will be the same as for the netlink messages). This is suitable for governors that only care about trip crossing events, like Bang-Bang.

The other one will be invoked once per thermal zone update, after all of the trips have been processed by the core, so the governors using it will have to walk the trips by themselves, but they may also skip the trip walk entirely if they don't need it, like the Power Allocator.

The .trip_crossed() callback is introduced in the first patch. Next, the Banb-Bang governor is switched over to using it (instead of .throttle()) and cleaned up.

The .manage() callback is introduced subsequently (in patch [05/16]) and the Power Allocator, Step-Wise and Fair-Share governors are made use it instead of .throttle(), in this order. The latter two are then modified to use trip point thresholds instead of trip temperatures, which they should be doing. Still, all of the patches changing one governor are grouped together.

Finally, the User Space governor is modified to use the .trip_crossed() callback instead of .throttle() and the latter is dropped from the code because it has no more users.

In addition, the handling of critical and hot trip points is relocated to eliminate a redundant check.

Please refer to the individual patch changelogs for details.

The series is on top of the linux-next branch in linux-pm.git, which by now should have been included into linux-next.

There is also a git branch where it can be found:

https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/log/?h=thermal-core-testing

Thanks!