diff options
author | Alexey Starikovskiy <alexey_y_starikovskiy@linux.intel.com> | 2006-07-31 14:25:20 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-08-11 17:59:56 -0400 |
commit | 1ce28d6b19112a7c76af8e971e2de3109d19a943 (patch) | |
tree | 5fe089fa4b9851ca4c975a5e13f636f95fa43078 /drivers/cpufreq | |
parent | cd878479792cc1e4bc9d62ed0ef2c4454743848c (diff) |
[CPUFREQ][1/2] ondemand: updated tune for hardware coordination
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>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 52cf1f021825..f507a869acbc 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -305,6 +305,9 @@ static void do_dbs_timer(void *data) | |||
305 | { | 305 | { |
306 | unsigned int cpu = smp_processor_id(); | 306 | unsigned int cpu = smp_processor_id(); |
307 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); | 307 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); |
308 | /* We want all CPUs to do sampling nearly on same jiffy */ | ||
309 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | ||
310 | delay -= jiffies % delay; | ||
308 | 311 | ||
309 | if (!dbs_info->enable) | 312 | if (!dbs_info->enable) |
310 | return; | 313 | return; |
@@ -312,18 +315,18 @@ static void do_dbs_timer(void *data) | |||
312 | lock_cpu_hotplug(); | 315 | lock_cpu_hotplug(); |
313 | dbs_check_cpu(dbs_info); | 316 | dbs_check_cpu(dbs_info); |
314 | unlock_cpu_hotplug(); | 317 | unlock_cpu_hotplug(); |
315 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, | 318 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); |
316 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | ||
317 | } | 319 | } |
318 | 320 | ||
319 | static inline void dbs_timer_init(unsigned int cpu) | 321 | static inline void dbs_timer_init(unsigned int cpu) |
320 | { | 322 | { |
321 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); | 323 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); |
324 | /* We want all CPUs to do sampling nearly on same jiffy */ | ||
325 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | ||
326 | delay -= jiffies % delay; | ||
322 | 327 | ||
323 | INIT_WORK(&dbs_info->work, do_dbs_timer, 0); | 328 | INIT_WORK(&dbs_info->work, do_dbs_timer, 0); |
324 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, | 329 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); |
325 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | ||
326 | return; | ||
327 | } | 330 | } |
328 | 331 | ||
329 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 332 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |