Re: [PATCH 2.6.28-rc5 00/11] Kernel memory leak detector (updated)

From: Catalin Marinas
Date: Thu Nov 20 2008 - 13:10:57 EST


On Thu, 2008-11-20 at 13:22 +0100, Ingo Molnar wrote:
> * Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
> I'd like to try it in the -tip automated testing setup, provided the
> few details i just commented on are solved, and provided that these
> things are addressed as well:
>
> > Things still to be done:
> >
> > - kernel thread to scan and report leaked objects periodically
> > (currently done only when reading the /sys/kernel/debug/memleak
> > file)
> > - run-time and boot-time configuration like task stacks scanning,
> > disabling kmemleak, enabling/disabling the automatic scanning
>
> the .config driven automatic "report currently known/suspected leaks
> 60 seconds after bootup" feature would be nice to have. Should be
> fairly easy to add, right? Otherwise i'd have no good way of getting a
> leak report out of it, in an automated way.

This can be easily done and it will be part of the automatic scanning
mentioned above (after the first scan, I think a scan every 10 min would
be enough). The only issue is that currently a leak is reported after it
was found at least a number of times (the 2nd time by default) to avoid
transient reports where a pointer was held in registers for example. A
better approach might be to check the allocation jiffies and ignore the
very recent ones.

As for reporting, I think it should print a diff with the previous scan
otherwise you may end up with duplicated information in the log.

I'll look at implementing this over the following days and re-post.
Thanks for the other comments as well.

--
Catalin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/