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

From: David Rientjes
Date: Mon May 11 2009 - 18:31:22 EST


On Mon, 11 May 2009, Andrew Morton wrote:

> __GFP_NOFAIL is a bad fiction. Allocations _can_ fail, and callers should
> detect and suitably handle this (and not by lamely moving the infinite
> loop up to the caller level either).
>
> Attempting to use __GFP_NOFAIL for a higher-order allocation is even
> worse, so add a once-off runtime check for this to slap people around for
> even thinking about trying it.
>
> Cc: David Rientjes <rientjes@xxxxxxxxxx>
> Cc: Mel Gorman <mel@xxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

This only emits a warning when you have CONFIG_DEBUG_KERNEL,
CONFIG_FAULT_INJECTION, and CONFIG_FAIL_PAGE_ALLOC, which is all related
to fault injection (since we never want to inject a fault into anything
using __GFP_NOFAIL). So it may be helpful in tracking down such callers,
but is unrelated to the config options that enable it and it may not get
the best coverage.
--
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/