[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1245245007.11889.42.camel@pc1117.cambridge.arm.com>
Date: Wed, 17 Jun 2009 14:23:27 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: Mel Gorman <mel@....ul.ie>, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
torvalds@...ux-foundation.org, fengguang.wu@...el.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kmemleak: Only use GFP_KERNEL|GFP_ATOMIC for the
internal allocations
On Wed, 2009-06-17 at 16:01 +0300, Pekka Enberg wrote:
> On Wed, Jun 17, 2009 at 3:52 PM, Catalin Marinas<catalin.marinas@....com> wrote:
> > Kmemleak allocates memory for pointer tracking and it tries to avoid
> > using GFP_ATOMIC if the caller doesn't require it. However other gfp
> > flags may be passed by the caller which aren't required by kmemleak.
> > This patch filters the gfp flags so that only GFP_KERNEL | GFP_ATOMIC
> > are used.
> >
> > Signed-off-by: Catalin Marinas <catalin.marinas@....com>
>
> Is this really safe? What if we're in a middle of a filesystem
> operation that uses GFP_NOFAIL and all of a sudden kmemleak allocation
> fails and causes a panic?
A kmemleak_panic() call only disables the kmemleak but doesn't stop the
kernel. The __GFP_NOFAIL allocation had already happened and the pointer
returned to the caller.
If we pass the __GFP_NOFAIL flag via the kmemleak's alloc, we get the
warning reported by Ingo (though it's not clear to me why this happens
as a kmemleak_object cache allocation is 192 bytes on a 32 bit machine).
Are there (common) situations where we expect kmemleak's alloc to fail
without __GFP_NOFAIL?
--
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