]> err.no Git - linux-2.6/commitdiff
[CPUFREQ][1/2] ondemand: updated tune for hardware coordination
authorAlexey Starikovskiy <alexey_y_starikovskiy@linux.intel.com>
Mon, 31 Jul 2006 18:25:20 +0000 (22:25 +0400)
committerDave Jones <davej@redhat.com>
Fri, 11 Aug 2006 21:59:56 +0000 (17:59 -0400)
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>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq_ondemand.c

index 52cf1f02182591f64f527144e1e3a1394ee9a050..f507a869acbc029128ac52c405219d3364679086 100644 (file)
@@ -305,6 +305,9 @@ static void do_dbs_timer(void *data)
 {
        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 @@ static void do_dbs_timer(void *data)
        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)