[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1445967059-6897-48-git-send-email-czoborbalint@gmail.com>
Date: Tue, 27 Oct 2015 18:30:36 +0100
From: Bálint Czobor <czoborbalint@...il.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Viresh Kumar <viresh.kumar@...aro.org>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Todd Poynor <toddpoynor@...gle.com>,
Bálint Czobor <czoborbalint@...il.com>
Subject: [PATCH 48/70] cpufreq: interactive: reduce chance of zero time delta on load eval
From: Todd Poynor <toddpoynor@...gle.com>
Reschedule load sampling timer after timestamp of sample start taken,
hold spinlock across entire sequence to avoid preemption. Avoid the
WARN for zero time delta in the load sampling timer function.
Change-Id: Idc10a756f09141decb6df92669521a1ebf0dbc10
Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
Signed-off-by: Bálint Czobor <czoborbalint@...il.com>
---
drivers/cpufreq/cpufreq_interactive.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 1b5d930..b4d12b2 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -169,21 +169,23 @@ static inline cputime64_t get_cpu_idle_time(unsigned int cpu,
static void cpufreq_interactive_timer_resched(
struct cpufreq_interactive_cpuinfo *pcpu)
{
- unsigned long expires = jiffies + usecs_to_jiffies(timer_rate);
+ unsigned long expires;
unsigned long flags;
- mod_timer_pinned(&pcpu->cpu_timer, expires);
- if (timer_slack_val >= 0 && pcpu->target_freq > pcpu->policy->min) {
- expires += usecs_to_jiffies(timer_slack_val);
- mod_timer_pinned(&pcpu->cpu_slack_timer, expires);
- }
-
spin_lock_irqsave(&pcpu->load_lock, flags);
pcpu->time_in_idle =
get_cpu_idle_time(smp_processor_id(),
&pcpu->time_in_idle_timestamp);
pcpu->cputime_speedadj = 0;
pcpu->cputime_speedadj_timestamp = pcpu->time_in_idle_timestamp;
+ expires = jiffies + usecs_to_jiffies(timer_rate);
+ mod_timer_pinned(&pcpu->cpu_timer, expires);
+
+ if (timer_slack_val >= 0 && pcpu->target_freq > pcpu->policy->min) {
+ expires += usecs_to_jiffies(timer_slack_val);
+ mod_timer_pinned(&pcpu->cpu_slack_timer, expires);
+ }
+
spin_unlock_irqrestore(&pcpu->load_lock, flags);
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists