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-next>] [day] [month] [year] [list]
Date:	Tue, 21 Sep 2010 13:23:17 -0400
From:	Davidlohr Bueso <dave@....org>
To:	catalin.marinas@....com
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] kmemleak: add unlikely() optimization to kmemleak_late_init

kmemleak: add unlikely() optimization to kmemleak_late_init()

Since there it is not very probable that kmemleak_disable() was called right after setting kmemleak_initialized, we could benefit from predicting it.

Signed-off-by: Davidlohr Bueso <dave@....org>
---
 mm/kmemleak.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index bd9bc21..7e2f260 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1728,7 +1728,7 @@ static int __init kmemleak_late_init(void)
 
 	atomic_set(&kmemleak_initialized, 1);
 
-	if (atomic_read(&kmemleak_error)) {
+	if (unlikely(atomic_read(&kmemleak_error))) {
 		/*
 		 * Some error occured and kmemleak was disabled. There is a
 		 * small chance that kmemleak_disable() was called immediately
-- 
1.7.0.4



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