From: Catalin Marinas <catalin.marinas@arm.com>
To: Christoph Lameter <cl@linux.com>
Cc: "Bird, Tim" <Tim.Bird@sonymobile.com>,
"Frank Rowand" <frowand.list@gmail.com>,
"Pekka Enberg" <penberg@kernel.org>,
"Matt Mackall" <mpm@selenic.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"Linux Kernel list" <linux-kernel@vger.kernel.org>,
"Bobniev, Roman" <Roman.Bobniev@sonymobile.com>,
"Andersson, Björn" <Bjorn.Andersson@sonymobile.com>
Subject: Re: [PATCH] slub: Proper kmemleak tracking if CONFIG_SLUB_DEBUG disabled
Date: Wed, 2 Oct 2013 17:25:28 +0100 [thread overview]
Message-ID: <20131002162528.GD29794@arm.com> (raw)
In-Reply-To: <0000014179e31953-a05dd7d1-d0f8-474f-810a-809cd8a724f8-000000@email.amazonses.com>
On Wed, Oct 02, 2013 at 04:57:12PM +0100, Christoph Lameter wrote:
> On Wed, 2 Oct 2013, Bird, Tim wrote:
>
> > The problem child is actually the unconditional call to kmemleak_alloc()
> > in kmalloc_large_node() (in slub.c). The problem comes because that call
> > is unconditional on CONFIG_SLUB_DEBUG but the kmemleak
> > calls in the hook routines are conditional on CONFIG_SLUB_DEBUG.
> > So if you have CONFIG_SLUB_DEBUG=n but CONFIG_DEBUG_KMEMLEAK=y,
> > you get the false reports.
>
> Right. You need to put the #ifdef CONFIG_SLUB_DEBUG around the hooks that
> need it in the function itself instead of disabling the whole function if
> CONFIG_SLUB_DEUBG is not set.
If we are to do this, we also need a DEBUG_KMEMLEAK dependency,
something like:
depends on (SLUB && SLUB_DEBUG) || !SLUB
or
select SLUB_DEBUG if SLUB
Otherwise you get a lot of false positives.
But with any of the above, #ifdef'ing out kmemleak_* calls wouldn't make
much difference since they would already be no-ops in kmemleak.h with
!SLUB_DEBUG.
> > Personally, I like the idea of keeping bookeeping/tracing/debug stuff in hook
> > routines. I also like de-coupling CONFIG_SLUB_DEBUG and CONFIG_DEBUG_KMEMLEAK,
> > but maybe others have a different opinon. Unless someone speaks up, we'll
> > move the the currently in-function kmemleak calls into hooks, and all of the
> > kmemleak stuff out from under CONFIG_SLUB_DEBUG.
> > We'll have to see if the ifdefs get a little messy.
>
> Decouple of you want. CONFIG_SLUB_DEBUG may duplicate what you already do.
I would prefer the decoupling but I'm fine either way (as long as the
dependencies are in place).
--
Catalin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Christoph Lameter <cl@linux.com>
Cc: "Bird, Tim" <Tim.Bird@sonymobile.com>,
"Frank Rowand" <frowand.list@gmail.com>,
"Pekka Enberg" <penberg@kernel.org>,
"Matt Mackall" <mpm@selenic.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"Linux Kernel list" <linux-kernel@vger.kernel.org>,
"Bobniev, Roman" <Roman.Bobniev@sonymobile.com>,
"Andersson, Björn" <Bjorn.Andersson@sonymobile.com>
Subject: Re: [PATCH] slub: Proper kmemleak tracking if CONFIG_SLUB_DEBUG disabled
Date: Wed, 2 Oct 2013 17:25:28 +0100 [thread overview]
Message-ID: <20131002162528.GD29794@arm.com> (raw)
In-Reply-To: <0000014179e31953-a05dd7d1-d0f8-474f-810a-809cd8a724f8-000000@email.amazonses.com>
On Wed, Oct 02, 2013 at 04:57:12PM +0100, Christoph Lameter wrote:
> On Wed, 2 Oct 2013, Bird, Tim wrote:
>
> > The problem child is actually the unconditional call to kmemleak_alloc()
> > in kmalloc_large_node() (in slub.c). The problem comes because that call
> > is unconditional on CONFIG_SLUB_DEBUG but the kmemleak
> > calls in the hook routines are conditional on CONFIG_SLUB_DEBUG.
> > So if you have CONFIG_SLUB_DEBUG=n but CONFIG_DEBUG_KMEMLEAK=y,
> > you get the false reports.
>
> Right. You need to put the #ifdef CONFIG_SLUB_DEBUG around the hooks that
> need it in the function itself instead of disabling the whole function if
> CONFIG_SLUB_DEUBG is not set.
If we are to do this, we also need a DEBUG_KMEMLEAK dependency,
something like:
depends on (SLUB && SLUB_DEBUG) || !SLUB
or
select SLUB_DEBUG if SLUB
Otherwise you get a lot of false positives.
But with any of the above, #ifdef'ing out kmemleak_* calls wouldn't make
much difference since they would already be no-ops in kmemleak.h with
!SLUB_DEBUG.
> > Personally, I like the idea of keeping bookeeping/tracing/debug stuff in hook
> > routines. I also like de-coupling CONFIG_SLUB_DEBUG and CONFIG_DEBUG_KMEMLEAK,
> > but maybe others have a different opinon. Unless someone speaks up, we'll
> > move the the currently in-function kmemleak calls into hooks, and all of the
> > kmemleak stuff out from under CONFIG_SLUB_DEBUG.
> > We'll have to see if the ifdefs get a little messy.
>
> Decouple of you want. CONFIG_SLUB_DEBUG may duplicate what you already do.
I would prefer the decoupling but I'm fine either way (as long as the
dependencies are in place).
--
Catalin
next prev parent reply other threads:[~2013-10-02 16:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 20:38 [PATCH] slub: Proper kmemleak tracking if CONFIG_SLUB_DEBUG disabled Frank Rowand
2013-09-27 20:38 ` Frank Rowand
2013-09-30 9:04 ` Catalin Marinas
2013-09-30 9:04 ` Catalin Marinas
2013-10-02 14:41 ` Christoph Lameter
2013-10-02 14:41 ` Christoph Lameter
2013-10-02 15:33 ` Bird, Tim
2013-10-02 15:33 ` Bird, Tim
2013-10-02 15:54 ` Catalin Marinas
2013-10-02 15:54 ` Catalin Marinas
2013-10-02 16:24 ` Christoph Lameter
2013-10-02 16:24 ` Christoph Lameter
2013-10-02 15:57 ` Christoph Lameter
2013-10-02 15:57 ` Christoph Lameter
2013-10-02 16:25 ` Catalin Marinas [this message]
2013-10-02 16:25 ` Catalin Marinas
-- strict thread matches above, loose matches on Subject: below --
2013-10-08 22:37 [PATCH] slub: proper " Tim Bird
2013-10-08 22:37 ` Tim Bird
2013-10-08 22:58 Tim Bird
2013-10-08 22:58 ` Tim Bird
2013-10-09 13:28 ` Catalin Marinas
2013-10-09 13:28 ` Catalin Marinas
2013-10-09 19:07 ` Christoph Lameter
2013-10-09 19:07 ` Christoph Lameter
2013-10-23 11:52 ` Bobniev, Roman
2013-10-23 11:52 ` Bobniev, Roman
2013-10-24 17:20 ` Pekka Enberg
2013-10-24 17:20 ` Pekka Enberg
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=20131002162528.GD29794@arm.com \
--to=catalin.marinas@arm.com \
--cc=Bjorn.Andersson@sonymobile.com \
--cc=Roman.Bobniev@sonymobile.com \
--cc=Tim.Bird@sonymobile.com \
--cc=cl@linux.com \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@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.