From 659b4fc70b26c2a002492689cdd3ca17269a63e9 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Tue, 16 Jun 2009 15:32:18 -0700 Subject: [PATCH] --- yaml --- r: 151547 b: refs/heads/master c: 72807a74c0172376bba6b5b27702c9f702b526e9 h: refs/heads/master i: 151545: e9331c2365cdce5fae1d10008c0102fc4d7608bf 151543: fde6b1d21c69cacc29c2e7cf880fd4fa24253089 v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 877ad12f9d1e..13def7b3f944 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 092cead6175bb1b3d3078a34ba71c939d526c70b +refs/heads/master: 72807a74c0172376bba6b5b27702c9f702b526e9 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 5dac5d8cb148..85759cdd6973 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -1446,9 +1446,6 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order, int zlc_active = 0; /* set if using zonelist_cache */ int did_zlc_setup = 0; /* just call zlc_setup() one time */ - if (WARN_ON_ONCE(order >= MAX_ORDER)) - return NULL; - classzone_idx = zone_idx(preferred_zone); zonelist_scan: /* @@ -1706,6 +1703,15 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, unsigned long did_some_progress; struct task_struct *p = current; + /* + * In the slowpath, we sanity check order to avoid ever trying to + * reclaim >= MAX_ORDER areas which will never succeed. Callers may + * be using allocators in order of preference for an area that is + * too large. + */ + if (WARN_ON_ONCE(order >= MAX_ORDER)) + return NULL; + /* * GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and * __GFP_NOWARN set) should not cause reclaim since the subsystem