Re: [PATCH 02/22] Do not sanity check order in the fast path

Dave Hansen
2009-04-24T14:17:19Z

On Fri, 2009-04-24 at 11:34 +0100, Mel Gorman wrote:
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 1464aca..1c60141 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1434,7 +1434,6 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
> int did_zlc_setup = 0; /* just call zlc_setup() one time */
>
> classzone_idx = zone_idx(preferred_zone);
> - VM_BUG_ON(order >= MAX_ORDER);
>
> zonelist_scan:
> /*
> @@ -1692,6 +1691,15 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> 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
> * (f.e. slab) using GFP_THISNODE may choose to trigger reclaim

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>

-- Dave