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

Ingo Molnar
2009-05-09T08:32:20Z

* Pekka Enberg <penberg@cs.helsinki.fi> wrote:

> On Fri, 2009-05-08 at 11:29 -0400, Christoph Lameter wrote:
> > On Fri, 8 May 2009, Pekka Enberg wrote:
> >
> > > From: Pekka Enberg <penberg@cs.helsinki.fi>
> > >
> > > This patch introduces a GFP_PANIC flag that can be used as an annotation
> > > that an early-boot call to kmalloc() or alloc_pages() is expected to
> > > never fail.
> >
> > I think the early-boot requirement needs to be dropped. Make this safe to
> > be used at anytime.
>
> OK, here's an updated patch description:
>
> Subject: [PATCH 1/2] mm: Introduce GFP_PANIC
> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> This patch introduces a GFP_PANIC flag that can be used as an annotation
> that a kmalloc() or alloc_pages() call is expected to never fail which is
> useful for early-boot code, for example.
>
> To save one GFP flag bit, use a combination of __GFP_NOFAIL and
> __GFP_NOREPEAT to make sure we always end up in the "nopage" path of the
> page allocator if an allocation fails.
>
> [ gorcunov@openvz.org: initial version of the patch ]
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Rik van Riel <riel@redhat.com>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>

Thanks Pekka for taking care of this,

Acked-by: Ingo Molnar <mingo@elte.hu>

Ingo