lkml.org 
[lkml]   [2011]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kmemleak: Reduce verbosity when memory allocation fails
On Mon, 10 Jan 2011, Catalin Marinas wrote:

> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index bd9bc21..eee8e31 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -113,7 +113,8 @@
> #define BYTES_PER_POINTER sizeof(void *)
>
> /* GFP bitmask for kmemleak internal allocations */
> -#define GFP_KMEMLEAK_MASK (GFP_KERNEL | GFP_ATOMIC)
> +#define gfp_kmemleak_mask(gfp) ((gfp) & (GFP_KERNEL | GFP_ATOMIC) | \
> + __GFP_NOWARN)

It would be a shame if the allocation were __GFP_NORETRY and kmemleak
ended up looping forever because it suppresses the bit for a single page,
it uses __GFP_NOMEMALLOC and kmemleak ends up allocating from memory
reserves, or it uses __GFP_HARDWALL and kmemleak is allocating metadata in
a different cpuset.

I'm not sure why you're not just masking __GFP_NOFAIL and __GFP_REPEAT and
then failing gracefully? (And __GFP_ZERO and __GFP_COMP, too, of course.)


\
 
 \ /
  Last update: 2011-01-10 21:39    [W:0.064 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site