All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@gnu.org>
To: catalin.marinas@arm.com
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] kmemleak: add unlikely() optimization to kmemleak_late_init
Date: Tue, 21 Sep 2010 13:23:17 -0400	[thread overview]
Message-ID: <1285089797.2177.2.camel@cowboy> (raw)

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




             reply	other threads:[~2010-09-21 17:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 17:23 Davidlohr Bueso [this message]
2010-09-22 10:06 ` [PATCH] kmemleak: add unlikely() optimization to kmemleak_late_init Catalin Marinas
2010-09-23 14:05   ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285089797.2177.2.camel@cowboy \
    --to=dave@gnu.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.