Re: [RFC/PATCH v2] mm: Introduce GFP_PANIC for non-failingallocations

From: Pekka Enberg
Date: Fri May 08 2009 - 10:40:05 EST


Hi Rik,

On Fri, 2009-05-08 at 10:37 -0400, Rik van Riel wrote:
> > @@ -1556,7 +1556,8 @@ nofail_alloc:
> > zonelist, high_zoneidx, ALLOC_NO_WATERMARKS);
> > if (page)
> > goto got_pg;
> > - if (gfp_mask & __GFP_NOFAIL) {
> > + /* GFP_PANIC sets both flags */
> > + if ((gfp_mask & __GFP_NOFAIL) && !(gfp_mask & __GFP_NORETRY)) {
> > congestion_wait(WRITE, HZ/50);
>
> Do you mean ((gfp_mask & GFP_PANIC) == GFP_PANIC)) ?

No, we only want to loop if __GFP_NOFAIL is set but __GFP_NORETRY is not
set.

>
> > @@ -1670,6 +1671,9 @@ nopage:
> > dump_stack();
> > show_mem();
> > }
> > + if (unlikely(gfp_mask & GFP_PANIC))
> > + panic("Out of memory: %s order: %d, gfp_mask:0x%x\n",
> > + p->comm, order, gfp_mask);
>
> Ditto here.

Yes, indeed. Fixed up. Thanks!

--
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/