public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/6] thermal: core: Pass trip pointers to governor .throttle() callbacks
@ 2023-10-06 17:38 Rafael J. Wysocki
  2023-10-06 17:40 ` [PATCH v1 1/6] thermal: trip: Simplify computing trip indices Rafael J. Wysocki
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Rafael J. Wysocki @ 2023-10-06 17:38 UTC (permalink / raw)
  To: Linux PM
  Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui, Lukasz Luba

Hi All,

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!




^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-10-20 17:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 17:38 [PATCH v1 0/6] thermal: core: Pass trip pointers to governor .throttle() callbacks Rafael J. Wysocki
2023-10-06 17:40 ` [PATCH v1 1/6] thermal: trip: Simplify computing trip indices Rafael J. Wysocki
2023-10-12 14:27   ` Daniel Lezcano
2023-10-12 16:21     ` Rafael J. Wysocki
2023-10-20 16:58   ` Lukasz Luba
2023-10-20 17:04     ` Rafael J. Wysocki
2023-10-06 17:41 ` [PATCH v1 2/6] thermal: trip: Define for_each_trip() macro Rafael J. Wysocki
2023-10-12 14:44   ` Daniel Lezcano
2023-10-20 17:15   ` Lukasz Luba
2023-10-20 17:19     ` Rafael J. Wysocki
2023-10-06 17:42 ` [PATCH v1 3/6] thermal: gov_fair_share: Rearrange get_trip_level() Rafael J. Wysocki
2023-10-12 15:04   ` Daniel Lezcano
2023-10-12 16:29     ` Rafael J. Wysocki
2023-10-06 17:47 ` [PATCH v1 4/6] thermal: gov_power_allocator: Use trip pointers instead of trip indices Rafael J. Wysocki
2023-10-12 15:19   ` Daniel Lezcano
2023-10-12 16:36     ` Rafael J. Wysocki
2023-10-20 16:37   ` Lukasz Luba
2023-10-20 16:41     ` Rafael J. Wysocki
2023-10-06 17:49 ` [PATCH v1 5/6] thermal: gov_step_wise: Fold update_passive_instance() into its caller Rafael J. Wysocki
2023-10-12 15:24   ` Daniel Lezcano
2023-10-20 16:17   ` Lukasz Luba
2023-10-20 16:31     ` Rafael J. Wysocki
2023-10-06 17:51 ` [PATCH v1 6/6] thermal: core: Pass trip pointer to governor throttle callback Rafael J. Wysocki
2023-10-12 15:29   ` Daniel Lezcano
2023-10-13  8:12 ` [PATCH v1 0/6] thermal: core: Pass trip pointers to governor .throttle() callbacks Lukasz Luba
2023-10-13 10:07   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox