linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Sankar P <sankar.curiosity@gmail.com>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
	rnagarajan@novell.com, teheo@novell.com,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Luis Rodriguez <Luis.Rodriguez@atheros.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: Probable Bug (or configuration error) in kmemleak
Date: Fri, 18 Jun 2010 14:00:58 +0100	[thread overview]
Message-ID: <1276866058.28780.48.camel@e102109-lin.cambridge.arm.com> (raw)
In-Reply-To: <AANLkTimb7rP0rS0OU8nan5uNEhHx_kEYL99ImZ3c8o0D@mail.gmail.com>

On Fri, 2010-06-18 at 09:11 +0100, Sankar P wrote:
> On Thu, Jun 17, 2010 at 11:06 PM, Luis R. Rodriguez
> <lrodriguez@atheros.com> wrote:
> > On Thu, Jun 17, 2010 at 02:21:56AM -0700, Sankar P wrote:
> >> Hi,
> >>
> >> I wanted to detect memory leaks in one of my kernel modules. So I
> >> built Linus' tree  with the following config options enabled (on top
> >> of make defconfig)
> >>
> >> CONFIG_DEBUG_KMEMLEAK=y
> >> CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
> >> CONFIG_DEBUG_KMEMLEAK_TEST=y
> >>
> >> If I boot with this kernel, debugfs is automatically mounted. But I do
> >> not have the file:
> >>
> >> /sys/kernel/debug/kmemleak
> >>
> >> created at all. There are other files like kprobes in the mounted
> >> /sys/kernel/debug directory btw. So I am not able to detect any of the
> >> memory leaks. Is there anything I am doing wrong or missing (or) is
> >> this a bug in kmemleak ?
> >>
> >> Please let me know your suggestions to fix this and get memory leaks
> >> reporting working. Thanks.
> >>
> >> The full .config file is also attached with this mail. Sorry for the
> >> attachment, I did not want to paste 5k lines in the mail. Sorry if it
> >> is wrong.
> >
> >
> > This is odd.. Do you see this message on your kernel ring buffer?
> >
> > Failed to create the debugfs kmemleak file
> >
> 
> I dont see such an error in the dmesg output. But I got another
> interesting error:
> 
> [    0.000000] kmemleak: Early log buffer exceeded, please increase
> DEBUG_KMEMLEAK_EARLY_LOG_SIZE
> [    0.000000] kmemleak: Kernel memory leak detector disabled

You would need to increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE. The default of
400 seems ok for me but it may not work with some other kernel
configurations (that's a static array for logging memory allocations
before the kmemleak is fully initialised and can start tracking them).

> But after that also, I see some other lines like:
> 
> [    0.511641] kmemleak: vmalloc(64) = f7857000
> [    0.511645] kmemleak: vmalloc(64) = f785a000

This is because you compiler the test module into the kernel
(DEBUG_KMEMLEAK_TEST). It's not kmemleak printing this but it's testing
module (which leaks memory on purpose).

> The variable  DEBUG_KMEMLEAK_EARLY_LOG_SIZE was set to 400 by default.
> I changed it to 4000 and then 40000 (may be should try < 32567 ?) but
> still I get the same error message and the file
> /sys/kernel/debug/kmem* is never created at all.

This shouldn't usually happen with values greater than 2000. From your
kernel log, the version seems to be 2.6.32. Do you have the same
problems with 2.6.35-rc3?

Your .config seems to refer to the 2.6.35-rc3 kernel - are you checking
the right image?

-- 
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>

  reply	other threads:[~2010-06-18 13:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  9:21 Sankar P
2010-06-17 17:36 ` Luis R. Rodriguez
2010-06-18  8:11   ` Sankar P
2010-06-18 13:00     ` Catalin Marinas [this message]
2010-06-18 13:25       ` Sankar P
2010-06-22  6:54         ` Sankar P
2010-06-22  6:58     ` [PATCH] mm: kmemleak: Change kmemleak default buffer size Sankar P
2010-06-22  8:11       ` Pekka Enberg
2010-06-22  8:46         ` [PATCH] kmemleak: config-options: Default buffer size for kmemleak Sankar P
2010-06-22 11:31           ` Paul Mundt
2010-06-22 12:05             ` Catalin Marinas
2010-06-22 12:14               ` Paul Mundt
2010-06-22 12:21               ` Pekka Enberg
2010-06-22 12:35                 ` Catalin Marinas
2010-06-22 12:41                   ` Pekka Enberg
2010-06-22 16:55       ` [PATCH] mm: kmemleak: Change kmemleak default buffer size Luis R. Rodriguez
2010-06-24  7:31         ` Sankar P
2010-06-24 18:56           ` Luis R. Rodriguez

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=1276866058.28780.48.camel@e102109-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Luis.Rodriguez@atheros.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lrodriguez@atheros.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rnagarajan@novell.com \
    --cc=sankar.curiosity@gmail.com \
    --cc=teheo@novell.com \
    /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