]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
page-allocator: warn if __GFP_NOFAIL is used for a large allocation
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 16 Jun 2009 22:32:37 +0000 (15:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:40 +0000 (19:47 -0700)
commitdab48dab37d2770824420d1e01730a107fade1aa
tree81e949d2521d4d8d979808feaa9c2a570337a98c
parent720b17e759a50635c429ccaa2ec3d01edb4f92d6
page-allocator: warn if __GFP_NOFAIL is used for a large allocation

__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@google.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c