From: Jocelyn Falempe Date: Tue, 22 Sep 2009 12:27:24 +0000 (+0200) Subject: cpufreq: ondemand: Don't synchronize sample rate unless mulitple cpus present X-Git-Tag: firefly_0821_release~11655 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=beb070f3d41fb82c69c6dcec1293817c7c788d10;p=firefly-linux-kernel-4.4.55.git 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 --- 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 */