Commit b3c466ce authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

page allocator: do not sanity check order in the fast path

No user of the allocator API should be passing in an order >= MAX_ORDER
but we check for it on each and every allocation.  Delete this check and
make it a VM_BUG_ON check further down the call path.

Signed-off-by: default avatarMel Gorman <>
Reviewed-by: default avatarChristoph Lameter <>
Reviewed-by: default avatarKOSAKI Motohiro <>
Reviewed-by: default avatarPekka Enberg <>
Cc: Peter Zijlstra <>
Cc: Nick Piggin <>
Cc: Dave Hansen <>
Cc: Lee Schermerhorn <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent d239171e
......@@ -185,9 +185,6 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order,
static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
unsigned int order)
if (unlikely(order >= MAX_ORDER))
return NULL;
/* Unknown node is current node */
if (nid < 0)
nid = numa_node_id();
......@@ -201,9 +198,6 @@ extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);
static inline struct page *
alloc_pages(gfp_t gfp_mask, unsigned int order)
if (unlikely(order >= MAX_ORDER))
return NULL;
return alloc_pages_current(gfp_mask, order);
extern struct page *alloc_page_vma(gfp_t gfp_mask,
......@@ -1401,6 +1401,9 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
classzone_idx = zone_idx(preferred_zone);
if (WARN_ON_ONCE(order >= MAX_ORDER))
return NULL;
* Scan zonelist, looking for a zone with enough free.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment