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

From: David Rientjes
Date: Mon May 11 2009 - 19:37:41 EST


On Mon, 11 May 2009, Andrew Morton wrote:

> That assumes that the oom-killer is triggered - in the typical
> kernel developer testing, that won't happen.
>
> I think what we should do here is to prevent people even attempting to
> use __GFP_NOFAIL with higher-order allocations.
>

You could just add WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL) in the check for
order != 0 in __alloc_pages_internal() to keep it out of the fastpath and
make it appear when we have to reclaim. That still probably has less
coverage than you want, but these allocations have a high probability of
triggering reclaim anyway so it should be pretty obvious.

> Are you aware of any callsite which is presently using __GFP_NOFAIL on
> order>0 allocations?
>

Nope.

> I expect slub might cause this to happen due to its habit of using
> larger-than-needed orders for small objects. For example, cxgb3 is
> passing __GFP_NOFAIL into alloc_skb().
>

slub_max_order is set to PAGE_ALLOC_COSTLY_ORDER by default, so this would
have to be overridden by the user on the command line unless a single
object can't fit into such a slab.
--
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/