From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Pierre Gondois <pierre.gondois@arm.com>, linux-kernel@vger.kernel.org
Cc: Shrikanth Hegde <sshegde@linux.vnet.ibm.com>,
vschneid@redhat.com, "Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: Rebuild sched-domains when removing cpufreq driver
Date: Tue, 19 Sep 2023 01:03:52 +0200 [thread overview]
Message-ID: <ebc8f4cd-1ac6-e7c8-8e20-53bca964ce56@arm.com> (raw)
In-Reply-To: <20230918112937.493352-1-pierre.gondois@arm.com>
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)
next prev parent reply other threads:[~2023-09-18 23:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 11:29 Pierre Gondois
2023-09-18 11:29 ` Pierre Gondois
2023-09-18 23:03 ` Dietmar Eggemann [this message]
2023-09-19 7:49 ` Pierre Gondois
2023-09-20 5:29 ` Shrikanth Hegde
2023-09-21 22:04 ` Dietmar Eggemann
2023-09-28 7:18 ` Viresh Kumar
2023-09-28 12:49 ` Pierre Gondois
2023-09-29 3:27 ` Viresh Kumar
2023-09-29 7:22 ` Pierre Gondois
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=ebc8f4cd-1ac6-e7c8-8e20-53bca964ce56@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=sshegde@linux.vnet.ibm.com \
--cc=viresh.kumar@linaro.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®