linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: linux-next: manual merge of the kmemleak tree
Date: Tue, 21 Apr 2009 12:47:10 +0100	[thread overview]
Message-ID: <1240314430.1369.18.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <1240312442.1369.9.camel@pc1117.cambridge.arm.com>

On Tue, 2009-04-21 at 12:14 +0100, Catalin Marinas wrote:
> On Thu, 2009-01-15 at 19:49 +0200, Eduard - Gabriel Munteanu wrote:
> > On Thu, Jan 15, 2009 at 12:04:57PM +0000, Catalin Marinas wrote:
> > > The only issue is that kmemleak would need to register the callbacks
> > > before the slab allocator is initialised (otherwise it may miss some
> > > allocations). So it would need a 3-stage initialisation - pre-slab,
> > > post-slab and late_initcall.
> > 
> > Sure, that is not a problem, as kmemtrace needn't be compiled in for
> > the tracepoints to work. As long as they're defined in some header and
> > included, you can register multiple probes from all over the kernel.
> > This also means you won't have to interact with kmemtrace code.
> 
> I noticed that the memory allocation tracepoints were merged into
> mainline. I'll modify kmemleak to use them and probably add another for
> vmalloc.

After a quick look, it turns out not to be so simple. Kmemleak needs to
trace all the memory allocations (missing some could cause false
positives) and it currently has a static buffer to store the first
allocations before kmemleak is fully initialised.

Registering a probe requires memory allocations and therefore it needs
to be done after kmem_cache_init(). It means that kmemleak would miss
several allocations before it can register the probes. I don't see any
solution other than inserting kmemleak_*() calls near the tracing hooks.

Any other suggestion? Thanks.

-- 
Catalin

  reply	other threads:[~2009-04-21 11:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15  5:27 linux-next: manual merge of the kmemleak tree Stephen Rothwell
2009-01-15 10:29 ` Eduard - Gabriel Munteanu
2009-01-15 10:38   ` Ingo Molnar
2009-01-15 12:04   ` Catalin Marinas
2009-01-15 12:27     ` Ingo Molnar
2009-01-15 17:49     ` Eduard - Gabriel Munteanu
2009-04-21 11:14       ` Catalin Marinas
2009-04-21 11:47         ` Catalin Marinas [this message]
2009-04-21 18:02           ` Pekka Enberg
  -- strict thread matches above, loose matches on Subject: below --
2009-01-19  5:16 Stephen Rothwell
2009-01-15  5:27 Stephen Rothwell
2009-01-15  5:27 Stephen Rothwell
2009-01-15  5:27 Stephen Rothwell
2009-01-15  5:26 Stephen Rothwell

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=1240314430.1369.18.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=eduard.munteanu@linux360.ro \
    --cc=hpa@zytor.com \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).