lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  4 Apr 2014 12:06:09 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	tglx@...utronix.de
Cc:	linaro-kernel@...ts.linaro.org, fweisbec@...il.com,
	linaro-networking@...aro.org, Arvind.Chauhan@....com,
	linux-kernel@...r.kernel.org,
	Viresh Kumar <viresh.kumar@...aro.org>
Subject: [PATCH V2 26/36] hrtimer: take lock only once for a cpu_base in hrtimer_run_queues()

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@...aro.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

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ