All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/4] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs
@ 2016-04-20  2:39 Steve Muckle
  2016-04-20  2:39 ` [RFC PATCH 2/4] cpufreq: schedutil: " Steve Muckle
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Steve Muckle @ 2016-04-20  2:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: linux-kernel, linux-pm, Peter Zijlstra, Ingo Molnar,
	Vincent Guittot, Morten Rasmussen, Dietmar Eggemann, Juri Lelli,
	Patrick Bellasi, Michael Turquette

In preparation for the scheduler cpufreq callback happening
on remote CPUs, add support for this in the dbs governors.
The dbs governors make assumptions about the callback occurring
on the CPU being updated.

Signed-off-by: Steve Muckle <smuckle@linaro.org>
---
 drivers/cpufreq/cpufreq_governor.c | 21 +++++++++++++++++++--
 drivers/cpufreq/cpufreq_governor.h |  1 +
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 20f0a4e114d1..429d3a5b9866 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -248,6 +248,20 @@ static void dbs_irq_work(struct irq_work *irq_work)
 	schedule_work_on(smp_processor_id(), &policy_dbs->work);
 }
 
+#ifdef CONFIG_SMP
+static inline void dbs_irq_work_queue(struct policy_dbs_info *policy_dbs,
+				      int cpu)
+{
+	irq_work_queue_on(&policy_dbs->irq_work, cpu);
+}
+#else
+static inline void dbs_irq_work_queue(struct policy_dbs_info *policy_dbs,
+				      int cpu)
+{
+	irq_work_queue(&policy_dbs->irq_work);
+}
+#endif
+
 static void dbs_update_util_handler(struct update_util_data *data, u64 time,
 				    unsigned long util, unsigned long max)
 {
@@ -295,7 +309,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
 
 	policy_dbs->last_sample_time = time;
 	policy_dbs->work_in_progress = true;
-	irq_work_queue(&policy_dbs->irq_work);
+	dbs_irq_work_queue(policy_dbs, cdbs->cpu);
 }
 
 static void gov_set_update_util(struct policy_dbs_info *policy_dbs,
@@ -384,7 +398,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
 	struct dbs_data *dbs_data;
 	struct policy_dbs_info *policy_dbs;
 	unsigned int latency;
-	int ret = 0;
+	int j, ret = 0;
 
 	/* State should be equivalent to EXIT */
 	if (policy->governor_data)
@@ -394,6 +408,9 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
 	if (!policy_dbs)
 		return -ENOMEM;
 
+	for_each_cpu(j, policy->cpus)
+		per_cpu(cpu_dbs, j).cpu = j;
+
 	/* Protect gov->gdbs_data against concurrent updates. */
 	mutex_lock(&gov_dbs_data_mutex);
 
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index 3e0eb7c54903..1d5f4857ff80 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -122,6 +122,7 @@ struct cpu_dbs_info {
 	unsigned int prev_load;
 	struct update_util_data update_util;
 	struct policy_dbs_info *policy_dbs;
+	int cpu;
 };
 
 /* Common Governor data across policies */
-- 
2.4.10

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-05-06 20:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20  2:39 [RFC PATCH 1/4] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs Steve Muckle
2016-04-20  2:39 ` [RFC PATCH 2/4] cpufreq: schedutil: " Steve Muckle
2016-04-20  2:39 ` [RFC PATCH 3/4] intel_pstate: " Steve Muckle
2016-04-20 12:37   ` Rafael J. Wysocki
2016-04-21  2:20     ` Steve Muckle
2016-04-25 21:34       ` Rafael J. Wysocki
2016-04-20  2:39 ` [RFC PATCH 4/4] sched/fair: call cpufreq hook for remote wakeups Steve Muckle
2016-04-20 12:26 ` [RFC PATCH 1/4] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs Rafael J. Wysocki
2016-04-25 19:17   ` Steve Muckle
2016-04-25 21:28     ` Rafael J. Wysocki
2016-04-29 10:38 ` Viresh Kumar
2016-04-29 11:21   ` Rafael J. Wysocki
2016-05-06 20:53     ` Steve Muckle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.