thermal: core: Pass trip pointers to governor .throttle() callbacks
Get series with b4
b4 am 5734364.DvuYhMxLoT@kreacherVersions newest first · linked by author and title
- v2 Latest6 patches 3 repliesIn review
- v16 patches 19 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | thermal: trip: Simplify computing trip indicesdrivers/ | +5 | 1 reply | |
| 2/6 | thermal: trip: Define for_each_trip() macrodrivers/ drivers/ | +7 | 0 replies | |
| 3/6 | thermal: gov_fair_share: Rearrange get_trip_level()drivers/ | +14 | 1 reply | |
| 4/6 | thermal: gov_power_allocator: Use trip pointers instead of trip indicesdrivers/ | +49 | 1 reply | |
| 5/6 | thermal: gov_step_wise: Fold update_passive_instance() into its callerdrivers/ | +10 | 0 replies | |
| 6/6 | thermal: core: Pass trip pointer to governor throttle callbackdrivers/ drivers/ drivers/ +6 more | +51 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Lezcano |
|---|---|
| 1/6 | A-b |
| 2/6 | A-b |
| 3/6 | A-b |
| 4/6 | A-b |
| 5/6 | A-b |
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/6] thermal: core: Pass trip pointers to governor .throttle() callbacks
Hi All,
This is a v2 of
https://lore.kernel.org/linux-pm/13365827.uLZWGnKmhe@kreacher/
which only slightly updates 2 patches and adds some tags, so the cover letter below is still applicable:
While working on https://lore.kernel.org/linux-pm/4846448.GXAFRqVoOG@kreacher/
I started to change thermal governors so as to reduce the usage of trip indices in them. At that time, I was concerned that they could not be replaced with trip pointers overall, because they were needed in certain situations (tracing, debug messages, userspace governor) and computing them whenever they were needed would be extra overhead with relatively weak justification. In the meantime, however, I realized that for a given trip pointer, it is actually trivial to compute the corresponding index: it is sufficient to subtract the start of the trips[] table in the thermal zone containing the trip from that trip pointer for this purpose. Patch [1/6] modifies thermal_zone_trip_id() in accordance with this observation.
Now that the cost of computing a trip index for a given trip pointer and thermal zone is not a concern any more, the governors can be generally switched over to using trip pointers for representing trips. One of the things they need to do sometimes, though, is to iterate over trips in a given thermal zone (the core needs to do that too, of course) and for_each_thermal_trip() is somewhat inconvenient for this purpose, because it requires callback functions to be defined and in some cases new data types need to be introduced just in order to use it. For this reason, patch [2/6] adds a macro for iterating over trip points in a given thermal zone with the help of a trip pointer and changes for_each_thermal_trip() to use that macro internally.
Patches [3-5/6] change individual governors to prepare them for using trip pointers everywhere for representing trips, except for the trip argument of the .throttle() callback and patch [6/6] finally changes the .throttle() callback definition so that it takes a trip pointer as the argument representing the trip.
Please refer to the individual patch changelogs for details.
Thanks!