Re: [PATCH 1/2] mm: Introduce GFP_PANIC for early-boot allocations

Pekka Enberg
2009-05-09T08:44:19Z

Hi Andrew,

Andrew Morton wrote:
> On Fri, 08 May 2009 18:10:28 +0300
> Pekka Enberg <penberg@cs.helsinki.fi> wrote:
>
>> +#define GFP_PANIC (__GFP_NOFAIL | __GFP_NORETRY)
>
> urgh, you have to be kidding me. This significantly worsens complexity
> and risk in core MM and it's just yuk.
>
> I think we can justify pulling such dopey party tricks to save
> pageframe space, or bits in page.flags and such. But just to save a
> scrap of memory which would have been released during boot anwyay?
> Don't think so.

No, I wasn't kidding and I don't agree that it "significantly worsens
complexity". The point is not to save memory but to clearly annotate
those special call-sites that really don't need to check for out-of-memory.

But anyway, if you don't want it, then I guess it stays out of the kernel.

Andrew Morton wrote:
> I'd suggest panic_if_null(). Or just leave everything alone - it's
> hardly a pressing problem.

It has no advantage over the current BUG_ON() pattern.

Pekka