[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hshbbbTncpkZoS98jq+ChiARSZCNn5P8kaEduADbmHSw@mail.gmail.com>
Date: Tue, 23 Sep 2025 14:46:43 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Zihuan Zhang <zhangzihuan@...inos.cn>
Cc: "Rafael J. wysocki" <rafael@...nel.org>, Viresh Kumar <viresh.kumar@...aro.org>,
"zhenglifeng (A)" <zhenglifeng1@...wei.com>, Linux PM <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Question] About unnecessary policy_has_boost_freq() calls in freq_table.c
Hi,
On Tue, Sep 23, 2025 at 10:53 AM Zihuan Zhang <zhangzihuan@...inos.cn> wrote:
>
> Hi all,
>
> While reviewing the cpufreq code, I noticed that in
> cpufreq_table_validate_and_sort() the function policy_has_boost_freq()
> is still being called, even though most cpufreq drivers do not make use
> of the CPUFREQ_BOOST_FREQ flag.
>
> code in cpufreq_table_validate_and_sort():
>
> /* Driver's may have set this field already */
> if (policy_has_boost_freq(policy))
> policy->boost_supported = true;
>
>
> For drivers like acpi-cpufreq that don’t rely on CPUFREQ_BOOST_FREQ
> flag, this extra check looks confusing and possibly unnecessary.
>
> Would it make sense to move this check into cpufreq_boost_set_sw()
> instead, so that the call is only made when boost is actually relevant?
First off, setting policy->boost_supported doesn't really belong to
cpufreq_table_validate_and_sort(), so the idea of splitting it off
that function sounds reasonable to me.
However, cpufreq_boost_set_sw() is used as a .set_boost() callback, so
it gets called every time the "boost enabled" setting is changed. It
doesn't look like a good place for updating policy->boost_supported to
me.
Powered by blists - more mailing lists