Re: introducing __GFP_PANIC

David Rientjes
2009-05-03T20:59:15Z

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.