mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: <linux-pm@vger.kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Nicholas Chin <nic.c3.14@gmail.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] cpufreq: acpi: Don't enable boost on policy exit
Date: Thu, 24 Apr 2025 21:15:15 +0800	[thread overview]
Message-ID: <435855f8-7c92-4fc3-be07-8856772e729f@huawei.com> (raw)
In-Reply-To: <CAJZ5v0hLBE0vLvpw6k8E7KxiUGqXbH7wEZwFhEziJNYqfxJbyA@mail.gmail.com>

On 2025/4/24 19:26, Rafael J. Wysocki wrote:

> On Thu, Apr 24, 2025 at 9:15 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>
>> On 23-04-25, 16:14, Rafael J. Wysocki wrote:
>>> Even after commit 2b16c631832d, the code removed by this patch does a
>>> useful thing.  Namely, it clears the boost-disable bit in the MSR so
>>> that the offline CPU doesn't prevent online CPUs from getting the
>>> boost (in case the boost settings change after it has been taken
>>> offline).
>>
>> I didn't understand this part earlier (and even now). How does a CPU
>> with boost-disabled, prevents others from boosting ? I have tried
>> looking at git logs, and still don't understand it :(
> 
> At the HW level, this is certainly possible.
> 
> Say two (or more) cores are driven by the same VR.  Boost typically
> (always?) requires a separate OPP with a higher voltage and this
> applies to all cores sharing the VR, so if one of them says it doesn't
> want that (which is what the bit in the boost-disable MSR effectively
> means), they all won't get it.

IIUC, this means that if one sets unboost to policy A, another core in
policy B (but sharing the same VR with core in policy A) will not be able
to achieve boost freq too. Then if policy A goes exit, the core in policy B
will get back to boost freq (without patch 1). And then core in B will be
unboosted again after core in A goes online/resume (because of patch 2).
But in the entire process, the boost flag in policy B is always enabled.

Please tell me I misunderstood because it looks really weird.😥

> 
> They arguably should belong to the same cpufreq policy, but this
> information is often missing from the ACPI tables, sometimes on
> purpose (for instance, the firmware may want to be in charge of the
> frequency coordination between the cores).
> 
>> Also, IIUC this and the boost-enabling at init() only happens for one
>> CPU in a policy, as init() and exit() are only called for the first
>> and last CPU of a policy. So if a policy has multiple CPUs, we aren't
>> touching boost states of other CPUs at init/exit.
> 
> But there may be a policy per CPU.
> 
>> And yes, this patch isn't mandatory at all for the
>>
>>> Moreover, without the $subject patch, the change made by the next one
>>> will cause the boost setting in the MSR to get back in sync with
>>> policy->boost_enabled during online AFAICS, so why exactly is the
>>> $subject patch needed?
>>
>> Right, this is merely a cleanup patch and isn't really required for
>> the next patch to make it work.
> 
> So I'd rather not make this change.
> 
> Evidently, someone made the effort to put in a comment explaining the
> purpose of the code in question, so it looks like they had a reason
> for adding it.
> 


  reply	other threads:[~2025-04-24 13:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22  9:53 [PATCH 0/6] cpufreq: Boost related cleanups / fixes Viresh Kumar
2025-04-22  9:53 ` [PATCH 1/6] cpufreq: acpi: Don't enable boost on policy exit Viresh Kumar
2025-04-23  2:56   ` Nicholas Chin
2025-04-23 14:14   ` Rafael J. Wysocki
2025-04-24  7:15     ` Viresh Kumar
2025-04-24 11:26       ` Rafael J. Wysocki
2025-04-24 13:15         ` zhenglifeng (A) [this message]
2025-04-24 15:50         ` Viresh Kumar
2025-04-22  9:53 ` [PATCH 2/6] cpufreq: acpi: Re-sync CPU boost state on system resume Viresh Kumar
2025-04-23  2:57   ` Nicholas Chin
2025-04-23 14:26   ` Rafael J. Wysocki
2025-04-23 14:40     ` Rafael J. Wysocki
2025-04-23 14:59       ` Rafael J. Wysocki
2025-04-24  7:27         ` Viresh Kumar
2025-04-24 11:27           ` Rafael J. Wysocki
2025-04-22  9:53 ` [PATCH 3/6] cpufreq: Don't unnecessarily call set_boost() Viresh Kumar
2025-04-22  9:53 ` [PATCH 4/6] cpufreq: Introduce policy_set_boost() Viresh Kumar
2025-04-22  9:53 ` [PATCH 5/6] cpufreq: Preserve policy's boost state after resume Viresh Kumar
2025-04-22  9:53 ` [PATCH 6/6] cpufreq: Force sync policy boost with global boost on sysfs update Viresh Kumar
2025-04-22 12:33 ` [PATCH 0/6] cpufreq: Boost related cleanups / fixes zhenglifeng (A)

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=435855f8-7c92-4fc3-be07-8856772e729f@huawei.com \
    --to=zhenglifeng1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nic.c3.14@gmail.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /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®