All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ondemand: updated tune for hardware coordination
@ 2006-07-26 15:31 Alexey Starikovskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Starikovskiy @ 2006-07-26 15:31 UTC (permalink / raw)
  To: cpufreq


 cpufreq_ondemand.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Try to make dbs_check_cpu() call on all CPUs at the same jiffy.
This will help when multiple cores share P-states via Hardware Coordination.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com>

Index: linux-2.6.15.1/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
--- linux-2.6.15.1.orig/drivers/cpufreq/cpufreq_ondemand.c	2006-07-26 15:58:58.000000000 +0400
+++ linux-2.6.15.1/drivers/cpufreq/cpufreq_ondemand.c	2006-07-26 17:38:43.000000000 +0400
@@ -305,23 +305,26 @@
 {
 	unsigned int cpu = smp_processor_id();
 	struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
+	/* We want all CPUs to do sampling nearly on same jiffy */
+	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
+	delay -= jiffies % delay;
 
 	if (!dbs_info->enable)
 		return;
 
 	dbs_check_cpu(dbs_info);
-	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
-			usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
+	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 }
 
 static inline void dbs_timer_init(unsigned int cpu)
 {
 	struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
+	/* We want all CPUs to do sampling nearly on same jiffy */
+	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
+	delay -= jiffies % delay;
 
 	INIT_WORK(&dbs_info->work, do_dbs_timer, 0);
-	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
-			usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
-	return;
+	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 }
 
 static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 1/2] ondemand: updated tune for hardware coordination
@ 2006-07-31 18:25 Alexey Starikovskiy
  2006-07-31 22:37 ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Starikovskiy @ 2006-07-31 18:25 UTC (permalink / raw)
  To: Brown, Len, Dave Jones; +Cc: cpufreq


 cpufreq_ondemand.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Try to make dbs_check_cpu() call on all CPUs at the same jiffy.
This will help when multiple cores share P-states via Hardware Coordination.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com>

Index: linux-2.6.15.1/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
--- linux-2.6.15.1.orig/drivers/cpufreq/cpufreq_ondemand.c	2006-07-31 21:43:55.000000000 +0400
+++ linux-2.6.15.1/drivers/cpufreq/cpufreq_ondemand.c	2006-07-31 21:51:37.000000000 +0400
@@ -305,6 +305,9 @@
 {
 	unsigned int cpu = smp_processor_id();
 	struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
+	/* We want all CPUs to do sampling nearly on same jiffy */
+	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
+	delay -= jiffies % delay;
 
 	if (!dbs_info->enable)
 		return;
@@ -312,18 +315,18 @@
 	lock_cpu_hotplug();
 	dbs_check_cpu(dbs_info);
 	unlock_cpu_hotplug();
-	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
-			usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
+	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 }
 
 static inline void dbs_timer_init(unsigned int cpu)
 {
 	struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
+	/* We want all CPUs to do sampling nearly on same jiffy */
+	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
+	delay -= jiffies % delay;
 
 	INIT_WORK(&dbs_info->work, do_dbs_timer, 0);
-	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
-			usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
-	return;
+	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 }
 
 static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)

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

end of thread, other threads:[~2006-08-01 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-26 15:31 [PATCH 1/2] ondemand: updated tune for hardware coordination Alexey Starikovskiy
  -- strict thread matches above, loose matches on Subject: below --
2006-07-31 18:25 Alexey Starikovskiy
2006-07-31 22:37 ` Dave Jones
2006-08-01  8:09   ` Alexey Starikovskiy
2006-08-01 16:43     ` Dave Jones
2006-08-01 17:39       ` Alexey Starikovskiy

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.