Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a665df9d authored by Jocelyn Falempe's avatar Jocelyn Falempe Committed by Dave Jones
Browse files

[CPUFREQ] ondemand: don't synchronize sample rate unless multiple cpus present



For UP systems this is not required, and results in a more consistent
sample interval.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarJocelyn Falempe <jocelyn.falempe@motorola.com>
Signed-off-by: default avatarMike Chan <mike@android.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 226528c6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -609,7 +609,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);

	if (num_online_cpus() > 1)
		delay -= jiffies % delay;

	mutex_lock(&dbs_info->timer_mutex);

	/* Common NORMAL_SAMPLE setup */
@@ -634,6 +636,8 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
{
	/* We want all CPUs to do sampling nearly on same jiffy */
	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);

	if (num_online_cpus() > 1)
		delay -= jiffies % delay;

	dbs_info->sample_type = DBS_NORMAL_SAMPLE;