From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: <rafael@kernel.org>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
<jonathan.cameron@huawei.com>, <zhanjie9@hisilicon.com>,
<lihuisong@huawei.com>, <fanghao11@huawei.com>
Subject: Re: [PATCH v2 1/4] cpufreq: Fix re-boost issue after hotplugging a cpu
Date: Mon, 20 Jan 2025 17:10:44 +0800 [thread overview]
Message-ID: <6c58e779-db21-4553-a4da-dcc8591f8c34@huawei.com> (raw)
In-Reply-To: <20250120082723.am7rxujmdvzz4eky@vireshk-i7>
On 2025/1/20 16:27, Viresh Kumar wrote:
> Hi,
>
> I am bit confused by the sequence of events here and need some
> clarification. Lets assume that CPU can go from 1 GHz to 1.5 GHz
> without boost enabled and with boost it can go to 2 GHz.
>
> On 17-01-25, 18:14, Lifeng Zheng wrote:
>> It turns out that cpuX will stay on the base frequency after performing
>> these operations:
>>
>> 1. boost all cpus: echo 1 > /sys/devices/system/cpu/cpufreq/boost
>
> Boost enabled here, max_freq_req = 2 GHz.
>
>> 2. offline the cpu: echo 0 > /sys/devices/system/cpu/cpuX/online
>>
>> 3. deboost all cpus: echo 0 > /sys/devices/system/cpu/cpufreq/boost
>>
>> 4. online the cpu: echo 1 > /sys/devices/system/cpu/cpuX/online
>
> Boost is disabled currently here, but max_freq_req = 2 GHz, which is
> incorrect and the current change you are proposing fixes it I think.
> But it is not what you are claiming to fix.
Since boost is disabled, policy->max and policy->cpuinfo.max_freq will be
1.5GHz, this limits the actual frequency of the final.
>
>> 5. boost all cpus again: echo 1 > /sys/devices/system/cpu/cpufreq/boost
>
> Boost enabled again here, and max_freq_req = 2 GHz is the correct
> value.
In freq_qos_update_request(), if req->pnode.prio == new_value, it will
directly return 0 and not excecute freq_qos_apply(), in which will refresh
frequency. So the frequency will stay on base.
>
> So the CPU doesn't stay at base frequency here, but 2 GHz only.
>
>> This is because max_freq_req of the policy is not updated during the online
>> process, and the value of max_freq_req before the last offline is retained.
>
> which was 2 GHz in your example.
>
>> When the CPU is boosted again, freq_qos_update_request() will do nothing
>> because the old value is the same as the new one. This causes the CPU stay
>> on the base frequency. Update max_freq_req in cpufreq_online() will solve
>> this problem.
>
next prev parent reply other threads:[~2025-01-20 9:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 10:14 [PATCH v2 0/4] cpufreq: Fix some boost errors related to CPU online and offline Lifeng Zheng
2025-01-17 10:14 ` [PATCH v2 1/4] cpufreq: Fix re-boost issue after hotplugging a cpu Lifeng Zheng
2025-01-20 8:27 ` Viresh Kumar
2025-01-20 9:10 ` zhenglifeng (A) [this message]
2025-01-20 9:21 ` Viresh Kumar
2025-01-20 9:21 ` Viresh Kumar
2025-01-17 10:14 ` [PATCH v2 2/4] cpufreq: Introduce a more generic way to set default per-policy boost flag Lifeng Zheng
2025-01-20 9:01 ` Viresh Kumar
2025-01-21 1:45 ` zhenglifeng (A)
2025-01-21 4:20 ` Viresh Kumar
2025-01-21 6:22 ` zhenglifeng (A)
2025-01-21 6:37 ` Viresh Kumar
2025-02-04 16:41 ` Aboorva Devarajan
2025-02-05 5:01 ` Viresh Kumar
2025-02-05 18:22 ` Aboorva Devarajan
2025-01-17 10:14 ` [PATCH v2 3/4] cpufreq: CPPC: Fix wrong max_freq in policy initialization Lifeng Zheng
2025-01-20 9:28 ` Viresh Kumar
2025-01-17 10:14 ` [PATCH v2 4/4] cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init() Lifeng Zheng
2025-01-21 6:14 ` Viresh Kumar
2025-01-24 8:59 ` Viresh Kumar
2025-01-24 9:11 ` zhenglifeng (A)
2025-04-15 10:29 ` Viresh Kumar
2025-01-21 6:38 ` [PATCH v2 0/4] cpufreq: Fix some boost errors related to CPU online and offline Viresh Kumar
2025-01-23 20:07 ` Rafael J. Wysocki
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=6c58e779-db21-4553-a4da-dcc8591f8c34@huawei.com \
--to=zhenglifeng1@huawei.com \
--cc=fanghao11@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=lihuisong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=zhanjie9@hisilicon.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