Re: [PATCH 1/1] cpufreq: Set policy->min and max as real QoS constraints
From: Viresh Kumar
Date: Wed May 20 2026 - 04:19:54 EST
I was away on vacation, sorry for the delay.
On 11-05-26, 15:55, Pierre Gondois wrote:
> The above code can be split in 2 functionalities:
> A. Adding QoS constraints
> B. Fetching the min/max QoS constraint as initialized by the driver.
>
> I think the main constraints are:
> cpufreq_table_validate_and_sort()
> \-cpufreq_frequency_table_cpuinfo() [1]
> \-policy_has_boost_freq() [2]
>
> [1] policy->cpuinfo.max_freq is updated
> [2] Boost support is detected
>
> So the QoS logic relying on policy->boost_supported
> or policy->cpuinfo.max_freq (i.e. A. and B.) must be added
> after cpufreq_table_validate_and_sort().
>
> ---
>
> if (!new_policy && cpufreq_driver->online) {
> } else {
> cpufreq_driver->init()
> cpufreq_table_validate_and_sort()
Even we can remove the update of policy->min/max from
cpufreq_table_validate_and_sort(). Just set cpuinfo.
And right after the call, we can set policy->min/max.
> // [3]
> }
> The else branch is executed if the policy is not new and there
> is no .online() callback. To avoid initializing multiple times
> the QoS constraints, A. can be done at [3] but only if
> new_policy==true.
>
> ---
>
> I should have sent a V2 which does everything in a
> cpufreq_policy_init_qos(). Please let me know if this
> seems reasonable to you.
Setting policy->min/max should be considered separate from QoS I
think.
--
viresh