linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	smuckle.linux@gmail.com, juri.lelli@arm.com,
	Morten.Rasmussen@arm.com, patrick.bellasi@arm.com,
	eas-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: [PATCH V4 3/3] cpufreq: governor: Process remote callback for shared policies
Date: Wed, 26 Jul 2017 14:52:34 +0530	[thread overview]
Message-ID: <36285b16e7c6a60613097ec8e258a9af2f6ab736.1501060871.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1501060871.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1501060871.git.viresh.kumar@linaro.org>

This patch updates the legacy governors (ondemand/conservative) to
process cpufreq utilization update hooks to be called for remote CPUs.

Proper locking is already in place for shared policies and nothing extra
is required to be done.

Based on initial work from Steve Muckle.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq_governor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 5499796cf9a8..b1bf84149526 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -272,8 +272,8 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
 	struct policy_dbs_info *policy_dbs = cdbs->policy_dbs;
 	u64 delta_ns, lst;
 
-	/* Don't allow remote callbacks */
-	if (smp_processor_id() != data->cpu)
+	/* Allow remote callbacks only on the CPUs sharing cpufreq policy */
+	if (!cpumask_test_cpu(smp_processor_id(), policy_dbs->policy->cpus))
 		return;
 
 	/*
-- 
2.13.0.71.gd7076ec9c9cb

  parent reply	other threads:[~2017-07-26  9:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26  9:22 [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Viresh Kumar
2017-07-26  9:22 ` [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks Viresh Kumar
2017-07-26 17:42   ` Rafael J. Wysocki
2017-07-27  3:23     ` Viresh Kumar
2017-07-27  5:34   ` [Eas-dev] " Joel Fernandes (Google)
2017-07-27  5:50     ` Viresh Kumar
2017-07-27  6:13       ` Joel Fernandes (Google)
2017-07-27  7:14         ` Viresh Kumar
2017-07-27  9:10           ` Peter Zijlstra
2017-07-28  3:34           ` Joel Fernandes (Google)
2017-07-27  9:56   ` Peter Zijlstra
2017-07-26  9:22 ` [PATCH V4 2/3] cpufreq: schedutil: Process remote callback for shared policies Viresh Kumar
2017-07-27  5:49   ` [Eas-dev] " Joel Fernandes (Google)
2017-07-26  9:22 ` Viresh Kumar [this message]
2017-07-27  5:14 ` [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Joel Fernandes (Google)
2017-07-27  5:46   ` Viresh Kumar
2017-07-27  6:23     ` Joel Fernandes (Google)
2017-07-27  7:19       ` Viresh Kumar
2017-07-27  7:21       ` Juri Lelli
2017-07-28  3:44         ` Joel Fernandes (Google)

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=36285b16e7c6a60613097ec8e258a9af2f6ab736.1501060871.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=Morten.Rasmussen@arm.com \
    --cc=eas-dev@lists.linaro.org \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patrick.bellasi@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=smuckle.linux@gmail.com \
    --cc=vincent.guittot@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).