提交 a665df9d 编写于 作者: J Jocelyn Falempe 提交者: Dave Jones

[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: NJocelyn Falempe <jocelyn.falempe@motorola.com>
Signed-off-by: NMike Chan <mike@android.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDave Jones <davej@redhat.com>
上级 226528c6
...@@ -609,7 +609,9 @@ static void do_dbs_timer(struct work_struct *work) ...@@ -609,7 +609,9 @@ static void do_dbs_timer(struct work_struct *work)
/* We want all CPUs to do sampling nearly on same jiffy */ /* We want all CPUs to do sampling nearly on same jiffy */
int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 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); mutex_lock(&dbs_info->timer_mutex);
/* Common NORMAL_SAMPLE setup */ /* Common NORMAL_SAMPLE setup */
...@@ -634,7 +636,9 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) ...@@ -634,7 +636,9 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
{ {
/* We want all CPUs to do sampling nearly on same jiffy */ /* We want all CPUs to do sampling nearly on same jiffy */
int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
delay -= jiffies % delay;
if (num_online_cpus() > 1)
delay -= jiffies % delay;
dbs_info->sample_type = DBS_NORMAL_SAMPLE; dbs_info->sample_type = DBS_NORMAL_SAMPLE;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册