Re: [patch 08/11 -mmotm] oom: invoke oom killer for __GFP_NOFAIL

From: David Rientjes
Date: Mon May 11 2009 - 17:45:44 EST


On Mon, 11 May 2009, Andrew Morton wrote:

> > The oom killer must be invoked regardless of the order if the allocation
> > is __GFP_NOFAIL, otherwise it will loop forever when reclaim fails to
> > free some memory.
>
> We should discourage callers from using __GFP_NOFAIL at all. We should
> electrocute callers for using __GFP_NOFAIL on large allocations. How's about
>
> WARN_ON_ONCE(order > PAGE_ALLOC_COSTLY_ORDER &&
> (gfp_mask & __GFP_NOFAIL));
> or, preferably:
>
> WARN_ON_ONCE(order > 0 && (gfp_mask & __GFP_NOFAIL));
>

Not sure it would help since the oom killer will be now be called for such
an allocation and that dumps the stack (and will actually show the order
and gfp flags as well).
--
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/