Skip to contentSkip to conversation

ondemand: updated tune for hardware coordination

PATCH New Alexey Starikovskiy 1 participant 1 message Jul 26, 2006 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ondemand: updated tune for hardware coordination

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>
drivers/cpufreq/cpufreq_ondemand.c +0 -0
Index: linux-2.6.15.1/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
@@ -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)