lkml.org 
[lkml]   [2023]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] cpufreq: Rebuild sched-domains when removing cpufreq driver
From
On 18/09/2023 13:29, Pierre Gondois wrote:
> The Energy Aware Scheduler (EAS) relies on the schedutil governor.
> When moving to/from the schedutil governor, sched domains must be
> rebuilt to allow re-evaluating the enablement conditions of EAS.
> This is done through sched_cpufreq_governor_change().
>
> Having a cpufreq governor assumes having a cpufreq driver running.
> Inserting/removing a cpufreq driver should trigger a re-evaluation
> of EAS enablement conditions, avoiding to see EAS enabled when
> removing a running cpufreq driver.
>
> Add a sched_cpufreq_governor_change() call in cpufreq driver removal
> path.

Rebuilding SDs when inserting the driver is already covered by

cpufreq_online()
cpufreq_set_policy()
sched_cpufreq_governor_change()
if (old or new gov eq. schedutil)
schedule_work(&rebuild_sd_work)

So what's missing is only a sched_cpufreq_governor_change() call when
removing the driver, right?

>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
> drivers/cpufreq/cpufreq.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 60ed89000e82..0a4979c34fd1 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1673,6 +1673,8 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy)
> cpufreq_driver->exit(policy);
> policy->freq_table = NULL;
> }
> +
> + sched_cpufreq_governor_change(policy, policy->governor);
> }
>
> static int cpufreq_offline(unsigned int cpu)

\
 
 \ /
  Last update: 2023-09-19 01:05    [W:0.156 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site