[PATCH] kmemleak: add unlikely() optimization to kmemleak_late_init

From: Davidlohr Bueso
Date: Tue Sep 21 2010 - 13:23:29 EST


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@xxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/