thermal: gov_fair_share: Use .manage() callback instead of .throttle()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 10 Apr 2024 16:57:38 +0000 (18:57 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Apr 2024 08:15:04 +0000 (10:15 +0200)
commitbec55332c24eb671a1b6de17b38a70dee2472245
tree77238ee4681e29080088ef307578f13327ea48ac
parentfe036266504796c84adee28b64c347d3acf4206e
thermal: gov_fair_share: Use .manage() callback instead of .throttle()

The Fair Share governor tries very hard to be stateless and so it
calls get_trip_level() from fair_share_throttle() every time, even
though the number produced by this function for all of the trips
during a given thermal zone update is actually the same.  Since
get_trip_level() walks all of the trips in the thermal zone every
time it is called, doing this may generate quite a bit of completely
useless overhead.

For this reason, make the governor use the new .manage() callback
instead of .throttle() which allows it to call get_trip_level() just
once and use the value computed by it to handle all of the trips.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/gov_fair_share.c