Re: introducing __GFP_PANIC

From: David Rientjes
Date: Sun May 03 2009 - 16:59:18 EST


On Mon, 4 May 2009, Cyrill Gorcunov wrote:

> @@ -1685,7 +1687,9 @@ nopage:
> dump_stack();
> show_mem();
> }
> - return page;
> + if (unlikely(gfp_mask & __GFP_PANIC))
> + panic("Out of memory: panic due to __GFP_PANIC\n");
> + return NULL;
> got_pg:
> if (kmemcheck_enabled)
> kmemcheck_pagealloc_alloc(page, order, gfp_mask);
>

If we really want a __GFP_PANIC flag for this purpose, I'd recommend also
emitting the order and gfpmask in the panic() message since it may not be
immediately obvious from the caller.
--
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/