[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 12 Dec 2008 17:04:12 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: Dave Hansen <dave@...ux.vnet.ibm.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/15] kmemleak: Add memleak_alloc callback from
alloc_large_system_hash
On Thu, 2008-12-11 at 21:47 +0200, Pekka Enberg wrote:
> On Thu, 2008-12-11 at 17:38 +0000, Catalin Marinas wrote:
> >> Do you mean a comment? I can do this.
>
> On Thu, Dec 11, 2008 at 7:45 PM, Dave Hansen <dave@...ux.vnet.ibm.com> wrote:
> > Yeah, something like
> >
> > /*
> > * kmemleak doesn't actually allocate memory when called this early
> > * so the GFP_ATOMIC here is actually meaningless, but consistent
> > * with the rest of this function.
> > */
> >
> > Maybe that's too verbose. :)
>
> I'd suggest just doing a separate kmemleak_early_alloc() hook without
> the gfp flag.
It looks to me like alloc_large_system_hash() could also be called at
some later point and it may even invoke __vmalloc() if hashdist is set.
So I would prefer not to introduce another hook and additional if's to
know which one to call. BTW, I think the callback should actually be (to
avoid duplicating the vmalloc call, with proper comment):
if (!hashdist)
memleak_alloc(table, size, 1, GFP_ATOMIC);
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists