mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: profiling likely/unlikely in slub.c
Date: Mon, 11 Jun 2007 12:07:38 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706111205330.19316@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070611185608.GB4592@alice>

On Mon, 11 Jun 2007, Eric Sesterhenn / Snakebyte wrote:

> 
> +unlikely | 40969931|  6228144  __slab_free()@:mm/slub.c@1606
> +unlikely | 47198075|        0  __slab_free()@:mm/slub.c@1599
> -likely   |        0| 47198075  slab_free()@:mm/slub.c@1660
> +unlikely | 47280864|        0  __slab_alloc()@:mm/slub.c@1475
> +unlikely |    26857|        0  new_slab()@:mm/slub.c@1107
> +unlikely | 47280864|        0  slab_alloc()@:mm/slub.c@1557
> 
> three of the unlikely cases are caused by "if (unlikely(SlabDebug(page)))"
> if SLUB_DEBUG is turned off, it really is unlikely, since SlabDebug()
> always returns 0, if SLUB_DEBUG is turned on it is likely (not sure if there are
> cases where it can return 0) therefore it makes sense to change this
> to likely for the SLUB_DEBUG case. 
> 
> The following patch changes the SlabDebug() functions to defines, so gcc
> can easily optimize the if away entirely and changes the unlikely() to a
> likely().
> 
> Remaining problem is, that if likely/unlikely profiling is turned on,
> gcc does not optimize away a likely(0), and they still show up in the
> stats... guess heisenbug is involved in this :-)

There is a fundamental misunderstanding here to think that SLUB_DEBUG 
would enable debugging. Not true. Debugging is enabled by booting with
"slub_debug".


It is true that SlabDebug() is always false if !CONFIG_SLUB_DEBUG. That is 
only the case for embedded systems that want to conserve memory.

      reply	other threads:[~2007-06-11 19:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 18:56 Eric Sesterhenn / Snakebyte
2007-06-11 19:07 ` Christoph Lameter [this message]

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=Pine.LNX.4.64.0706111205330.19316@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snakebyte@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®