2010-06-17 09:22:00

by Sankar P

[permalink] [raw]
Subject: Probable Bug (or configuration error) in kmemleak

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.

--
Sankar P
http://psankar.blogspot.com


Attachments:
kmem-psankar-config (114.67 kB)

2010-06-17 17:36:11

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Probable Bug (or configuration error) in kmemleak

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

Luis

2010-06-18 08:11:13

by Sankar P

[permalink] [raw]
Subject: Re: Probable Bug (or configuration error) in kmemleak

On Thu, Jun 17, 2010 at 11:06 PM, Luis R. Rodriguez
<[email protected]> 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

But after that also, I see some other lines like:

[ 0.511641] kmemleak: vmalloc(64) = f7857000
[ 0.511645] kmemleak: vmalloc(64) = f785a000

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.

Attached is the output of : dmesg | grep -i kmemleak

--
Sankar P
http://psankar.blogspot.com


Attachments:
psankar-dmsg (2.24 kB)

2010-06-18 13:04:55

by Catalin Marinas

[permalink] [raw]
Subject: Re: Probable Bug (or configuration error) in kmemleak

On Fri, 2010-06-18 at 09:11 +0100, Sankar P wrote:
> On Thu, Jun 17, 2010 at 11:06 PM, Luis R. Rodriguez
> <[email protected]> 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

2010-06-18 13:33:08

by Sankar P

[permalink] [raw]
Subject: Re: Probable Bug (or configuration error) in kmemleak

On Fri, Jun 18, 2010 at 6:30 PM, Catalin Marinas
<[email protected]> wrote:
> On Fri, 2010-06-18 at 09:11 +0100, Sankar P wrote:
>> On Thu, Jun 17, 2010 at 11:06 PM, Luis R. Rodriguez
>> <[email protected]> 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?
>

Ah sorry. I am testing by ssh into a remote machine. After installing
my kernel (after increasing the DEBUG_KMEMLEAK_EARLY_LOG_SIZE), Before
rebooting, I forgot to change the default-kernel this time. I will
check once again and will let you know. Thank you a lot for the
"dmesg" pointer.


--
Sankar P
http://psankar.blogspot.com

2010-06-22 06:54:33

by Sankar P

[permalink] [raw]
Subject: Re: Probable Bug (or configuration error) in kmemleak

On Fri, Jun 18, 2010 at 6:55 PM, Sankar P <[email protected]> wrote:
> On Fri, Jun 18, 2010 at 6:30 PM, Catalin Marinas
> <[email protected]> wrote:
>> On Fri, 2010-06-18 at 09:11 +0100, Sankar P wrote:
>>> On Thu, Jun 17, 2010 at 11:06 PM, Luis R. Rodriguez
>>> <[email protected]> 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?
>>
>
> Ah sorry. I am testing by ssh into a remote machine. After installing
> my kernel (after increasing the DEBUG_KMEMLEAK_EARLY_LOG_SIZE), Before
> rebooting, I forgot to change the default-kernel this time. I will
> check once again and will let you know. Thank you a lot for the
> "dmesg" pointer.
>
>

Thanks for your "dmesg" pointer, I was able to solve the problem. I
found that whenever I ran "defconfig", the value of 400 for
DEBUG_KMEMLEAK_EARLY_LOG_SIZE seem to be inadequate always. So I made
a trivial patch incrementing the value to 1000. This worked fine for
my debugging. So, take the patch I will send next, if you prefer.


--
Sankar P
http://psankar.blogspot.com

2010-06-22 06:59:13

by Sankar P

[permalink] [raw]
Subject: [PATCH] mm: kmemleak: Change kmemleak default buffer size

If we try to find the memory leaks in kernel that is
compiled with 'make defconfig', the default buffer size
seem to be inadequate. Change the buffer size from
400 to 1000, which is sufficient in most cases.

Signed-off-by: Sankar P <[email protected]>
---
arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
index 71f39c7..b02e5ae 100644
--- a/arch/sh/configs/sh7785lcr_32bit_defconfig
+++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
@@ -1710,7 +1710,7 @@ CONFIG_SCHEDSTATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_DEBUG_KMEMLEAK=y
-CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
+CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1000
# CONFIG_DEBUG_KMEMLEAK_TEST is not set
CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_RT_MUTEXES is not set
--
1.6.4.2

2010-06-22 08:11:30

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

Sankar P wrote:
> If we try to find the memory leaks in kernel that is
> compiled with 'make defconfig', the default buffer size
> seem to be inadequate. Change the buffer size from
> 400 to 1000, which is sufficient in most cases.
>
> Signed-off-by: Sankar P <[email protected]>
> ---
> arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
> index 71f39c7..b02e5ae 100644
> --- a/arch/sh/configs/sh7785lcr_32bit_defconfig
> +++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
> @@ -1710,7 +1710,7 @@ CONFIG_SCHEDSTATS=y
> # CONFIG_DEBUG_OBJECTS is not set
> # CONFIG_DEBUG_SLAB is not set
> CONFIG_DEBUG_KMEMLEAK=y
> -CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
> +CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1000
> # CONFIG_DEBUG_KMEMLEAK_TEST is not set
> CONFIG_DEBUG_PREEMPT=y
> # CONFIG_DEBUG_RT_MUTEXES is not set

I'm pretty sure you want to do this change in lib/Kconfig.debug.

2010-06-22 08:47:23

by Sankar P

[permalink] [raw]
Subject: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

If we try to find the memory leaks in kernel that is
compiled with 'make defconfig', the default buffer size
of DEBUG_KMEMLEAK_EARLY_LOG_SIZE seem to be inadequate.

Change the buffer size from 400 to 1000,
which is sufficient for most cases.

Signed-off-by: Sankar P <[email protected]>
---

Thanks to Pekka Enberg's comments on my previous mail, I am sending a better patch,
and adding new reviewers as suggested by the get_maintainer script.

lib/Kconfig.debug | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index e722e9d..5eb9463 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -382,7 +382,7 @@ config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
int "Maximum kmemleak early log entries"
depends on DEBUG_KMEMLEAK
range 200 40000
- default 400
+ default 1000
help
Kmemleak must track all the memory allocations to avoid
reporting false positives. Since memory may be allocated or
--
1.6.4.2

2010-06-22 11:32:00

by Paul Mundt

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, Jun 22, 2010 at 02:16:43PM +0530, Sankar P wrote:
> If we try to find the memory leaks in kernel that is
> compiled with 'make defconfig', the default buffer size
> of DEBUG_KMEMLEAK_EARLY_LOG_SIZE seem to be inadequate.
>
> Change the buffer size from 400 to 1000,
> which is sufficient for most cases.
>
Or you could just bump it up in your config where you seem to be hitting
this problem. The default of 400 is sufficient for most people, so
bloating it up for a corner case seems a bit premature. Perhaps
eventually we'll have no choice and have to tolerate the bloat, as we did
with LOG_BUF_SHIFT, but it's not obvious that we've hit that point with
kmemleak yet.

2010-06-22 12:10:17

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, 2010-06-22 at 12:31 +0100, Paul Mundt wrote:
> On Tue, Jun 22, 2010 at 02:16:43PM +0530, Sankar P wrote:
> > If we try to find the memory leaks in kernel that is
> > compiled with 'make defconfig', the default buffer size
> > of DEBUG_KMEMLEAK_EARLY_LOG_SIZE seem to be inadequate.
> >
> > Change the buffer size from 400 to 1000,
> > which is sufficient for most cases.
> >
> Or you could just bump it up in your config where you seem to be hitting
> this problem. The default of 400 is sufficient for most people, so
> bloating it up for a corner case seems a bit premature. Perhaps
> eventually we'll have no choice and have to tolerate the bloat, as we did
> with LOG_BUF_SHIFT, but it's not obvious that we've hit that point with
> kmemleak yet.

I agree. The 400 seems to be sufficient with standard kernel
configurations (I usually try some of the Ubuntu configs on x86). The
error message is hopefully clear enough about what needs to be changed.

The defconfig change for this specific platform may be a better option
but I thought defconfigs are to provide a stable (and maybe close to
optimal) configuration without all the debugging features enabled
(especially those slowing things down considerably).

--
Catalin

2010-06-22 12:14:26

by Paul Mundt

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, Jun 22, 2010 at 01:05:51PM +0100, Catalin Marinas wrote:
> On Tue, 2010-06-22 at 12:31 +0100, Paul Mundt wrote:
> > On Tue, Jun 22, 2010 at 02:16:43PM +0530, Sankar P wrote:
> > > If we try to find the memory leaks in kernel that is
> > > compiled with 'make defconfig', the default buffer size
> > > of DEBUG_KMEMLEAK_EARLY_LOG_SIZE seem to be inadequate.
> > >
> > > Change the buffer size from 400 to 1000,
> > > which is sufficient for most cases.
> > >
> > Or you could just bump it up in your config where you seem to be hitting
> > this problem. The default of 400 is sufficient for most people, so
> > bloating it up for a corner case seems a bit premature. Perhaps
> > eventually we'll have no choice and have to tolerate the bloat, as we did
> > with LOG_BUF_SHIFT, but it's not obvious that we've hit that point with
> > kmemleak yet.
>
> I agree. The 400 seems to be sufficient with standard kernel
> configurations (I usually try some of the Ubuntu configs on x86). The
> error message is hopefully clear enough about what needs to be changed.
>
> The defconfig change for this specific platform may be a better option
> but I thought defconfigs are to provide a stable (and maybe close to
> optimal) configuration without all the debugging features enabled
> (especially those slowing things down considerably).
>
I would be fine with that, but I don't see any correlation between the
posted dmesg and the defconfig? I've run the config in question without
hitting problems, so I'm a bit confused as to why that particular config
was singled out.

2010-06-22 12:21:20

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, Jun 22, 2010 at 3:05 PM, Catalin Marinas
<[email protected]> wrote:
> The defconfig change for this specific platform may be a better option
> but I thought defconfigs are to provide a stable (and maybe close to
> optimal) configuration without all the debugging features enabled
> (especially those slowing things down considerably).

The defconfig change was definitely not a clean solution to this
problem. Better bake the fix in Kconfig proper even if it means
dependency on CONFIG_SH or something.

2010-06-22 12:40:24

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, 2010-06-22 at 13:21 +0100, Pekka Enberg wrote:
> On Tue, Jun 22, 2010 at 3:05 PM, Catalin Marinas
> <[email protected]> wrote:
> > The defconfig change for this specific platform may be a better option
> > but I thought defconfigs are to provide a stable (and maybe close to
> > optimal) configuration without all the debugging features enabled
> > (especially those slowing things down considerably).
>
> The defconfig change was definitely not a clean solution to this
> problem. Better bake the fix in Kconfig proper even if it means
> dependency on CONFIG_SH or something.

OK, maybe something like this

default 1000 if SH
default 400

It seems that kbuild only considers the first encounter of "default".

Thanks.

--
Catalin

2010-06-22 12:41:29

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH] kmemleak: config-options: Default buffer size for kmemleak

On Tue, Jun 22, 2010 at 3:35 PM, Catalin Marinas
<[email protected]> wrote:
> On Tue, 2010-06-22 at 13:21 +0100, Pekka Enberg wrote:
>> On Tue, Jun 22, 2010 at 3:05 PM, Catalin Marinas
>> <[email protected]> wrote:
>> > The defconfig change for this specific platform may be a better option
>> > but I thought defconfigs are to provide a stable (and maybe close to
>> > optimal) configuration without all the debugging features enabled
>> > (especially those slowing things down considerably).
>>
>> The defconfig change was definitely not a clean solution to this
>> problem. Better bake the fix in Kconfig proper even if it means
>> dependency on CONFIG_SH or something.
>
> OK, maybe something like this
>
> ? ? ? ?default 1000 if SH
> ? ? ? ?default 400
>
> It seems that kbuild only considers the first encounter of "default".

Sure, I'm fine with that.

2010-06-22 16:55:15

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
> If we try to find the memory leaks in kernel that is
> compiled with 'make defconfig', the default buffer size
> seem to be inadequate. Change the buffer size from
> 400 to 1000, which is sufficient in most cases.
>
> Signed-off-by: Sankar P <[email protected]>

What's your full name? Please read the "Developer's Certificate of Origin 1.1"
It says:

then you just add a line saying

Signed-off-by: Random J Developer <[email protected]>

using your real name (sorry, no pseudonyms or anonymous contributions.)


Also you may want to post on a new thread instead of using this old thread
unless the maintainer is reading this and wants to pick it up.

Luis

> ---
> arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
> index 71f39c7..b02e5ae 100644
> --- a/arch/sh/configs/sh7785lcr_32bit_defconfig
> +++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
> @@ -1710,7 +1710,7 @@ CONFIG_SCHEDSTATS=y
> # CONFIG_DEBUG_OBJECTS is not set
> # CONFIG_DEBUG_SLAB is not set
> CONFIG_DEBUG_KMEMLEAK=y
> -CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
> +CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1000
> # CONFIG_DEBUG_KMEMLEAK_TEST is not set
> CONFIG_DEBUG_PREEMPT=y
> # CONFIG_DEBUG_RT_MUTEXES is not set
> --
> 1.6.4.2
>

2010-06-24 07:31:14

by Sankar P

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
<[email protected]> wrote:
> On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
>> If we try to find the memory leaks in kernel that is
>> compiled with 'make defconfig', the default buffer size
>> seem to be inadequate. Change the buffer size from
>> 400 to 1000, which is sufficient in most cases.
>>
>> Signed-off-by: Sankar P <[email protected]>
>
> What's your full name? Please read the "Developer's Certificate of Origin 1.1"
> It says:
>
> then you just add a line saying
>
> ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
>
> using your real name (sorry, no pseudonyms or anonymous contributions.)
>
>
> Also you may want to post on a new thread instead of using this old thread
> unless the maintainer is reading this and wants to pick it up.
>

In our part of the world, we dont have lastnames. We just use the
first letter of our father's name as the last name.

I will send the updated patch as a new mail, I thought it will be
easier to follow if all mails belongs to the same thread.

Thanks

> ?Luis
>
>> ---
>> ?arch/sh/configs/sh7785lcr_32bit_defconfig | ? ?2 +-
>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
>> index 71f39c7..b02e5ae 100644
>> --- a/arch/sh/configs/sh7785lcr_32bit_defconfig
>> +++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
>> @@ -1710,7 +1710,7 @@ CONFIG_SCHEDSTATS=y
>> ?# CONFIG_DEBUG_OBJECTS is not set
>> ?# CONFIG_DEBUG_SLAB is not set
>> ?CONFIG_DEBUG_KMEMLEAK=y
>> -CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
>> +CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1000
>> ?# CONFIG_DEBUG_KMEMLEAK_TEST is not set
>> ?CONFIG_DEBUG_PREEMPT=y
>> ?# CONFIG_DEBUG_RT_MUTEXES is not set
>> --
>> 1.6.4.2
>>
>



--
Sankar P
http://psankar.blogspot.com

2010-06-24 18:56:18

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
> <[email protected]> wrote:
> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
> >> If we try to find the memory leaks in kernel that is
> >> compiled with 'make defconfig', the default buffer size
> >> seem to be inadequate. Change the buffer size from
> >> 400 to 1000, which is sufficient in most cases.
> >>
> >> Signed-off-by: Sankar P <[email protected]>
> >
> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
> > It says:
> >
> > then you just add a line saying
> >
> > ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
> >
> > using your real name (sorry, no pseudonyms or anonymous contributions.)
> >
> >
> > Also you may want to post on a new thread instead of using this old thread
> > unless the maintainer is reading this and wants to pick it up.
> >
>
> In our part of the world, we dont have lastnames. We just use the
> first letter of our father's name as the last name.

Oh wow, what part of the world is that? Interesting.

> I will send the updated patch as a new mail, I thought it will be
> easier to follow if all mails belongs to the same thread.

It does help in-thread, but patches should be sent separately unless
you know for sure the maintainer *will* read this.

Luis

2010-06-24 19:12:22

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Thu, Jun 24, 2010 at 12:01:51PM -0700, Sankar P wrote:
> On Fri, Jun 25, 2010 at 12:26 AM, Luis R. Rodriguez
> <[email protected]> wrote:
> > On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
> >> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
> >> <[email protected]> wrote:
> >> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
> >> >> If we try to find the memory leaks in kernel that is
> >> >> compiled with 'make defconfig', the default buffer size
> >> >> seem to be inadequate. Change the buffer size from
> >> >> 400 to 1000, which is sufficient in most cases.
> >> >>
> >> >> Signed-off-by: Sankar P <[email protected]>
> >> >
> >> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
> >> > It says:
> >> >
> >> > then you just add a line saying
> >> >
> >> > ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
> >> >
> >> > using your real name (sorry, no pseudonyms or anonymous contributions.)
> >> >
> >> >
> >> > Also you may want to post on a new thread instead of using this old thread
> >> > unless the maintainer is reading this and wants to pick it up.
> >> >
> >>
> >> In our part of the world, we dont have lastnames. We just use the
> >> first letter of our father's name as the last name.
> >
> > Oh wow, what part of the world is that? Interesting.
> >
>
>
> It is in a place called "Tamil Nadu" in India. See
> http://en.wikipedia.org/wiki/Indian_name (First paragraph end)

Odd, I visited Tamil Nadu for a while and met quite a few folks who
have full last names, like the ones Cc'd. Does this differ between
area or what?

> >> I will send the updated patch as a new mail, I thought it will be
> >> easier to follow if all mails belongs to the same thread.
> >
> > It does help in-thread, but patches should be sent separately unless
> > you know for sure the maintainer *will* read this.
> >
>
> Okay I will take care next time. Thanks for the advice.
>
> Sent this off-thread as I was not sure if people might like talking
> about "Names" in LKML.

Actually it is important since the SOB is part of the development
process. If we cannot gaurantee names on the SOB then that needs
to be known too.

Luis

2010-06-24 19:17:52

by Sankar P

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Fri, Jun 25, 2010 at 12:42 AM, Luis R. Rodriguez
<[email protected]> wrote:
> On Thu, Jun 24, 2010 at 12:01:51PM -0700, Sankar P wrote:
>> On Fri, Jun 25, 2010 at 12:26 AM, Luis R. Rodriguez
>> <[email protected]> wrote:
>> > On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
>> >> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
>> >> <[email protected]> wrote:
>> >> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
>> >> >> If we try to find the memory leaks in kernel that is
>> >> >> compiled with 'make defconfig', the default buffer size
>> >> >> seem to be inadequate. Change the buffer size from
>> >> >> 400 to 1000, which is sufficient in most cases.
>> >> >>
>> >> >> Signed-off-by: Sankar P <[email protected]>
>> >> >
>> >> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
>> >> > It says:
>> >> >
>> >> > then you just add a line saying
>> >> >
>> >> > ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
>> >> >
>> >> > using your real name (sorry, no pseudonyms or anonymous contributions.)
>> >> >
>> >> >
>> >> > Also you may want to post on a new thread instead of using this old thread
>> >> > unless the maintainer is reading this and wants to pick it up.
>> >> >
>> >>
>> >> In our part of the world, we dont have lastnames. We just use the
>> >> first letter of our father's name as the last name.
>> >
>> > Oh wow, what part of the world is that? Interesting.
>> >
>>
>>
>> It is in a place called "Tamil Nadu" in India. See
>> http://en.wikipedia.org/wiki/Indian_name (First paragraph end)
>
> Odd, I visited Tamil Nadu for a while and met quite a few folks who
> have full last names, like the ones Cc'd. Does this differ between
> area or what?
>

Thiagarajan, Manoharan, Balasubramanian <= these are all first names.
Probably they are using their Father's full name as their last name.

>> >> I will send the updated patch as a new mail, I thought it will be
>> >> easier to follow if all mails belongs to the same thread.
>> >
>> > It does help in-thread, but patches should be sent separately unless
>> > you know for sure the maintainer *will* read this.
>> >
>>
>> Okay I will take care next time. Thanks for the advice.
>>
>> Sent this off-thread as I was not sure if people might like talking
>> about "Names" ?in LKML.
>
> Actually it is important since the SOB is part of the development
> process. If we cannot gaurantee names on the SOB then that needs
> to be known too.
>

okay.


--
Sankar P
http://psankar.blogspot.com

2010-06-24 19:21:19

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Thu, Jun 24, 2010 at 12:17 PM, Sankar P <[email protected]> wrote:
> On Fri, Jun 25, 2010 at 12:42 AM, Luis R. Rodriguez
> <[email protected]> wrote:
>> On Thu, Jun 24, 2010 at 12:01:51PM -0700, Sankar P wrote:
>>> On Fri, Jun 25, 2010 at 12:26 AM, Luis R. Rodriguez
>>> <[email protected]> wrote:
>>> > On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
>>> >> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
>>> >> <[email protected]> wrote:
>>> >> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
>>> >> >> If we try to find the memory leaks in kernel that is
>>> >> >> compiled with 'make defconfig', the default buffer size
>>> >> >> seem to be inadequate. Change the buffer size from
>>> >> >> 400 to 1000, which is sufficient in most cases.
>>> >> >>
>>> >> >> Signed-off-by: Sankar P <[email protected]>
>>> >> >
>>> >> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
>>> >> > It says:
>>> >> >
>>> >> > then you just add a line saying
>>> >> >
>>> >> >        Signed-off-by: Random J Developer <[email protected]>
>>> >> >
>>> >> > using your real name (sorry, no pseudonyms or anonymous contributions.)
>>> >> >
>>> >> >
>>> >> > Also you may want to post on a new thread instead of using this old thread
>>> >> > unless the maintainer is reading this and wants to pick it up.
>>> >> >
>>> >>
>>> >> In our part of the world, we dont have lastnames. We just use the
>>> >> first letter of our father's name as the last name.
>>> >
>>> > Oh wow, what part of the world is that? Interesting.
>>> >
>>>
>>>
>>> It is in a place called "Tamil Nadu" in India. See
>>> http://en.wikipedia.org/wiki/Indian_name (First paragraph end)
>>
>> Odd, I visited Tamil Nadu for a while and met quite a few folks who
>> have full last names, like the ones Cc'd. Does this differ between
>> area or what?
>>
>
> Thiagarajan, Manoharan, Balasubramanian <= these are all first names.
> Probably they are using their Father's full name as their last name.

And their first names are what then?

Luis

2010-06-24 19:27:13

by Sankar P

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Fri, Jun 25, 2010 at 12:50 AM, Luis R. Rodriguez
<[email protected]> wrote:
> On Thu, Jun 24, 2010 at 12:17 PM, Sankar P <[email protected]> wrote:
>> On Fri, Jun 25, 2010 at 12:42 AM, Luis R. Rodriguez
>> <[email protected]> wrote:
>>> On Thu, Jun 24, 2010 at 12:01:51PM -0700, Sankar P wrote:
>>>> On Fri, Jun 25, 2010 at 12:26 AM, Luis R. Rodriguez
>>>> <[email protected]> wrote:
>>>> > On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
>>>> >> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
>>>> >> <[email protected]> wrote:
>>>> >> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
>>>> >> >> If we try to find the memory leaks in kernel that is
>>>> >> >> compiled with 'make defconfig', the default buffer size
>>>> >> >> seem to be inadequate. Change the buffer size from
>>>> >> >> 400 to 1000, which is sufficient in most cases.
>>>> >> >>
>>>> >> >> Signed-off-by: Sankar P <[email protected]>
>>>> >> >
>>>> >> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
>>>> >> > It says:
>>>> >> >
>>>> >> > then you just add a line saying
>>>> >> >
>>>> >> > ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
>>>> >> >
>>>> >> > using your real name (sorry, no pseudonyms or anonymous contributions.)
>>>> >> >
>>>> >> >
>>>> >> > Also you may want to post on a new thread instead of using this old thread
>>>> >> > unless the maintainer is reading this and wants to pick it up.
>>>> >> >
>>>> >>
>>>> >> In our part of the world, we dont have lastnames. We just use the
>>>> >> first letter of our father's name as the last name.
>>>> >
>>>> > Oh wow, what part of the world is that? Interesting.
>>>> >
>>>>
>>>>
>>>> It is in a place called "Tamil Nadu" in India. See
>>>> http://en.wikipedia.org/wiki/Indian_name (First paragraph end)
>>>
>>> Odd, I visited Tamil Nadu for a while and met quite a few folks who
>>> have full last names, like the ones Cc'd. Does this differ between
>>> area or what?
>>>
>>
>> Thiagarajan, Manoharan, Balasubramanian <= these are all first names.
>> Probably they are using their Father's full name as their last name.
>
> And their first names are what then?
>

What I mean is:

Senthil Balasubramanian : Senthil is the person's first name.
"Balasubramanian" is his father's first name, which Mr.Senthil uses as
his last name. Mr Balasubramanian (who is senthil's father) will have
a name like: Balasubramanian Paramasivan, where "Paramasivan" is the
first name of Senthil's grandfather. (Paramasivan is a hypothetical
name here).

Such a Father's-first-name-as-last-name is a very common thing in
Tamil Nadu, India. Some people use the full firstname of father as the
last name, while some other just use the first letter, as it might
cause name conflicts. For instance, if a postal-mail is sent to "Mr.
Balasubramanian" then the postman will want to deliver it to Senthil's
father and not Senthil.

I hope I explained it clearly this time :-)

--
Sankar P
http://psankar.blogspot.com

2010-06-25 09:10:12

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

On Thu, Jun 24, 2010 at 12:27:10PM -0700, Sankar P wrote:
> On Fri, Jun 25, 2010 at 12:50 AM, Luis R. Rodriguez
> <[email protected]> wrote:
> > On Thu, Jun 24, 2010 at 12:17 PM, Sankar P <[email protected]> wrote:
> >> On Fri, Jun 25, 2010 at 12:42 AM, Luis R. Rodriguez
> >> <[email protected]> wrote:
> >>> On Thu, Jun 24, 2010 at 12:01:51PM -0700, Sankar P wrote:
> >>>> On Fri, Jun 25, 2010 at 12:26 AM, Luis R. Rodriguez
> >>>> <[email protected]> wrote:
> >>>> > On Thu, Jun 24, 2010 at 12:31:11AM -0700, Sankar P wrote:
> >>>> >> On Tue, Jun 22, 2010 at 10:25 PM, Luis R. Rodriguez
> >>>> >> <[email protected]> wrote:
> >>>> >> > On Mon, Jun 21, 2010 at 11:58:29PM -0700, Sankar P wrote:
> >>>> >> >> If we try to find the memory leaks in kernel that is
> >>>> >> >> compiled with 'make defconfig', the default buffer size
> >>>> >> >> seem to be inadequate. Change the buffer size from
> >>>> >> >> 400 to 1000, which is sufficient in most cases.
> >>>> >> >>
> >>>> >> >> Signed-off-by: Sankar P <[email protected]>
> >>>> >> >
> >>>> >> > What's your full name? Please read the "Developer's Certificate of Origin 1.1"
> >>>> >> > It says:
> >>>> >> >
> >>>> >> > then you just add a line saying
> >>>> >> >
> >>>> >> > ? ? ? ?Signed-off-by: Random J Developer <[email protected]>
> >>>> >> >
> >>>> >> > using your real name (sorry, no pseudonyms or anonymous contributions.)
> >>>> >> >
> >>>> >> >
> >>>> >> > Also you may want to post on a new thread instead of using this old thread
> >>>> >> > unless the maintainer is reading this and wants to pick it up.
> >>>> >> >
> >>>> >>
> >>>> >> In our part of the world, we dont have lastnames. We just use the
> >>>> >> first letter of our father's name as the last name.
> >>>> >
> >>>> > Oh wow, what part of the world is that? Interesting.
> >>>> >
> >>>>
> >>>>
> >>>> It is in a place called "Tamil Nadu" in India. See
> >>>> http://en.wikipedia.org/wiki/Indian_name (First paragraph end)
> >>>
> >>> Odd, I visited Tamil Nadu for a while and met quite a few folks who
> >>> have full last names, like the ones Cc'd. Does this differ between
> >>> area or what?
> >>>
> >>
> >> Thiagarajan, Manoharan, Balasubramanian <= these are all first names.
> >> Probably they are using their Father's full name as their last name.
> >
> > And their first names are what then?
> >
>
> What I mean is:
>
> Senthil Balasubramanian : Senthil is the person's first name.
> "Balasubramanian" is his father's first name, which Mr.Senthil uses as
> his last name. Mr Balasubramanian (who is senthil's father) will have
> a name like: Balasubramanian Paramasivan, where "Paramasivan" is the
> first name of Senthil's grandfather. (Paramasivan is a hypothetical
> name here).
>
> Such a Father's-first-name-as-last-name is a very common thing in
> Tamil Nadu, India. Some people use the full firstname of father as the
> last name, while some other just use the first letter, as it might
> cause name conflicts. For instance, if a postal-mail is sent to "Mr.
> Balasubramanian" then the postman will want to deliver it to Senthil's
> father and not Senthil.
>
> I hope I explained it clearly this time :-)

Indeed, thanks, so the letter only last name is really more of an
exemption? Or is it really common as well?

Luis

2010-06-25 09:18:58

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH] mm: kmemleak: Change kmemleak default buffer size

Hello,

On 06/25/2010 11:10 AM, Luis R. Rodriguez wrote:
>> I hope I explained it clearly this time :-)
>
> Indeed, thanks, so the letter only last name is really more of an
> exemption? Or is it really common as well?

Having full name for SOB is the requirement. Sankar P's full name is
Sankar P. That's as much as anyone cares or _should_ care, at least
on the list. If you wanna pursue further, can you please take it off
list?

Thanks.

--
tejun