lkml.org 
[lkml]   [2014]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 26/36] hrtimer: take lock only once for a cpu_base in hrtimer_run_queues()
Date
We are taking cpu_base->lock for every clock-base in hrtimer_run_queues() and
there is nothing in there which prevents us to take this lock only once. Modify
code to take lock only once for a cpu_base.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/hrtimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 2d9a7e2..c712960 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1466,8 +1466,8 @@ void hrtimer_run_queues(void)
if (cpu_base->active_bases)
hrtimer_get_softirq_time(cpu_base);

+ raw_spin_lock(&cpu_base->lock);
for_each_active_base(index, base, cpu_base, active_bases) {
- raw_spin_lock(&cpu_base->lock);
while ((node = timerqueue_getnext(&base->active))) {
struct hrtimer *timer;

@@ -1478,8 +1478,8 @@ void hrtimer_run_queues(void)

__run_hrtimer(timer, &base->softirq_time);
}
- raw_spin_unlock(&cpu_base->lock);
}
+ raw_spin_unlock(&cpu_base->lock);
}

/*
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-04-04 09:01    [W:0.135 / U:1.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site