Re: Possible kmemleak issue, but I'm confused

Tim Bird
2010-08-25T16:30:21Z

On 08/25/2010 02:19 AM, Catalin Marinas wrote:
>> What is the status of this patch relative to linux-next or Linus'
>> tree?
>
> This patch was merged in 2.6.31-rc1 but parts of it were later dropped
> in 2.6.34-rc1 (commit 23fb064b) when Tejun removed the legacy percpu
> allocator. The new percpu allocator in mm/percpu.c uses standard
> allocation methods like alloc_bootmem or kzalloc and kmemleak handles
> these already, so no need for extra code in kernel/module.c.

OK. This is just the information I needed. Thanks.

>> Our solution was just to make these specific calls to kmemleak_alloc
>> and kmemleak_free (in module.c) compile-time configurable.
>> I suspect that there is a better way to do this -- possibly by
>> detecting or noting that this situation exists for certain
>> platforms, and avoiding it without specific user interaction.
>
> For the 2.6.29 kernel (not mainline), you could have it compile-time
> configurable. Another option would be to hack create_object() in
> mm/kmemleak.c to not call kmemleak_stop("Cannot insert ..."), though
> this method could potentially hide other problems with kmemleak
> callbacks.

We'll stick with our compile-time option, then, and it sounds
like when we upgrade our kernel version we won't need to worry
about this issue.

Thanks very much! kmemleak is cool. :-)
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Network Entertainment
=============================