mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Guo Chen <guo.chen@oss.qualcomm.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Vincent Donnefort <vincent.donnefort@arm.com>,
	Len Brown <lenb@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	xin.liu@oss.qualcomm.com, aiqun.yu@oss.qualcomm.com,
	tengfei.fan@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com,
	Pavel Machek <pavel@kernel.org>
Subject: Re: [PATCH] PM: EM: Rank boost and non-boost frequencies separately
Date: Tue, 3 Nov 2026 09:37:51 +0000	[thread overview]
Message-ID: <2c3df215-3f64-4697-805f-11e6e39c7d4d@arm.com> (raw)
In-Reply-To: <738c61fa-0397-4faa-acae-e9b42f901d1d@oss.qualcomm.com>

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]

>>> +        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.
>>
> Hi Lukasz,
> 
> 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 possible
>> 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;
>>
> Agreed, this is simpler and gives the same result for the non-boost
> 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

      reply	other threads:[~2026-11-03  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30  8:10 Guo Chen
2026-11-02 15:28 ` Lukasz Luba
2026-11-03  7:14   ` Guo Chen
2026-11-03  7:16   ` Guo Chen
2026-11-03  9:37     ` Lukasz Luba [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c3df215-3f64-4697-805f-11e6e39c7d4d@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=aiqun.yu@oss.qualcomm.com \
    --cc=guo.chen@oss.qualcomm.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=pavel@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=tengfei.fan@oss.qualcomm.com \
    --cc=tingwei.zhang@oss.qualcomm.com \
    --cc=vincent.donnefort@arm.com \
    --cc=viresh.kumar@linaro.org \
    --cc=xin.liu@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®