cpufreq: Rebuild sched-domains when removing cpufreq driver
authorPierre Gondois <pierre.gondois@arm.com>
Thu, 5 Oct 2023 13:41:20 +0000 (15:41 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 6 Oct 2023 20:05:56 +0000 (22:05 +0200)
commite7a1b32e43b194bbf930281ae7f5149c420cd122
treeaccd4b82331b1a0d858fa7fdaacc124415eb5edf
parent9ef0ad49cc860c0860026c01abea68878c6d72f7
cpufreq: Rebuild sched-domains when removing cpufreq driver

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 a cpufreq driver is 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.

Rebuild the sched domains in schedutil's sugov_init()/sugov_exit(),
allowing to check EAS's enablement condition whenever schedutil
governor is initialized/exited from.
Move relevant code up in schedutil.c to avoid a split and conditional
function declaration.
Rename sched_cpufreq_governor_change() to sugov_eas_rebuild_sd().

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h
kernel/sched/cpufreq_schedutil.c