From beb070f3d41fb82c69c6dcec1293817c7c788d10 Mon Sep 17 00:00:00 2001 From: Jocelyn Falempe Date: Tue, 22 Sep 2009 14:27:24 +0200 Subject: [PATCH] cpufreq: ondemand: Don't synchronize sample rate unless mulitple cpus present For UP systems this is not required, and results in a more consistent sample interval. Signed-off-by: Jocelyn Falempe Signed-off-by: Mike Chan --- drivers/cpufreq/cpufreq_ondemand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 4b34ade2332b..5211924e45fb 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -576,7 +576,9 @@ static void do_dbs_timer(struct work_struct *work) /* 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 (num_online_cpus() > 1) + delay -= jiffies % delay; + mutex_lock(&dbs_info->timer_mutex); /* Common NORMAL_SAMPLE setup */ -- 2.34.1