Re: [PATCH] PM: EM: Rank boost and non-boost frequencies separately
From: Lukasz Luba
Date: Tue Nov 03 2026 - 04:43:06 EST
Hi Guo
On 11/3/26 07:16, Guo Chen wrote:
On 11/2/2026 11:28 PM, Lukasz Luba wrote:
On 10/30/26 08:10, Guo Chen wrote:
em_compute_costs() ranks all the frequencies of the table, boost ones
included. A non-boost frequency can be marked inefficient only because
a faster boost frequency has a lower or equal cost, e.g.
3.9 GHz 4.0 GHz (cost C) 4.1 GHz (boost, cost C)
[snip]
Hi Lukasz,+ bool boost = table[i].frequency > max_nonboost;
+
+ if (boost != prev_boost) {
We expect in EM fwk that the frequencies are sorted ascending
and we return error during setup if the driver callback fails
to provide that.
Therefore, in this code we don't have to deal with random
'boost' labels with gaps between.
Thanks for the review.
You are right. The boundary is derived from the highest non-boost
frequency, so with an ascending table the boost states always form a
contiguous top segment, and prev_boost is redundant.
Let's make all OPPs which are 'boost' equally possibleAgreed, this is simpler and gives the same result for the non-boost
to reach (at least in theory), so label them as
'efficient'. I think this is fair in 'boosting' case scenario
and energy has not that importance in it.
So simply something like, would be enough IMHO:
if (boost)
prev_cost = ULONG_MAX;
states. Boost states are no longer compared with each other, which is
also a sensible semantic. I will drop prev_boost and use the above in v2.
Cool, please make sure in your new implementation for the
corner case with the first non-boost OPP from top to be marked as
efficient (you can even force that).
Regards,
Lukasz
Thanks,
Guo