cpufreq: ondemand: Don't synchronize sample rate unless mulitple cpus present
authorJocelyn Falempe <jocelyn.falempe@motorola.com>
Tue, 22 Sep 2009 12:27:24 +0000 (14:27 +0200)
committerArve Hjønnevåg <arve@android.com>
Mon, 8 Feb 2010 23:36:08 +0000 (15:36 -0800)
For UP systems this is not required, and results in a more consistent
sample interval.

Signed-off-by: Jocelyn Falempe <jocelyn.falempe@motorola.com>
Signed-off-by: Mike Chan <mike@android.com>
drivers/cpufreq/cpufreq_ondemand.c

index 4b34ade2332baaa50bb1ca1af9c45e1a9893d321..5211924e45fba3ae7cce81586265a84cec2a3429 100644 (file)
@@ -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 */