Commit 6b65aaf3 authored by Minchan Kim's avatar Minchan Kim Committed by Pekka Enberg
Browse files

slub: Use alloc_pages_exact_node() for page allocation

The alloc_slab_page() in SLUB uses alloc_pages() if node is '-1'.  This means
that node validity check in alloc_pages_node is unnecessary and we can use
alloc_pages_exact_node() to avoid comparison and branch as commit

 ("page allocator: do not check NUMA node ID when the caller
knows the node is valid") did for the page allocator.

Cc: Christoph Lameter <>
Reviewed-by: default avatarKAMEZAWA Hiroyuki <>
Reviewed-by: default avatarMel Gorman <>
Signed-off-by: default avatarMinchan Kim <>
Signed-off-by: default avatarPekka Enberg <>
parent d3e14aa3
......@@ -1084,7 +1084,7 @@ static inline struct page *alloc_slab_page(gfp_t flags, int node,
if (node == -1)
return alloc_pages(flags, order);
return alloc_pages_node(node, flags, order);
return alloc_pages_exact_node(node, flags, order);
static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
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