path: root/mm/filemap.c
diff options
authorMel Gorman <>2009-06-16 15:31:54 -0700
committerLinus Torvalds <>2009-06-16 19:47:32 -0700
commit6484eb3e2a81807722c5f28efef94d8338b7b996 (patch)
tree10ce36f412c2ff0c7eb399af1a189f8e354f56db /mm/filemap.c
parentb3c466ce512923298ae8c0121d3e9f397a3f1210 (diff)
page allocator: do not check NUMA node ID when the caller knows the node is valid
Callers of alloc_pages_node() can optionally specify -1 as a node to mean "allocate from the current node". However, a number of the callers in fast paths know for a fact their node is valid. To avoid a comparison and branch, this patch adds alloc_pages_exact_node() that only checks the nid with VM_BUG_ON(). Callers that know their node is valid are then converted. Signed-off-by: Mel Gorman <> Reviewed-by: Christoph Lameter <> Reviewed-by: KOSAKI Motohiro <> Reviewed-by: Pekka Enberg <> Acked-by: Paul Mundt <> [for the SLOB NUMA bits] Cc: Peter Zijlstra <> Cc: Nick Piggin <> Cc: Dave Hansen <> Cc: Lee Schermerhorn <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/filemap.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 6846a902f5c..22396713feb 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -521,7 +521,7 @@ struct page *__page_cache_alloc(gfp_t gfp)
if (cpuset_do_page_mem_spread()) {
int n = cpuset_mem_spread_node();
- return alloc_pages_node(n, gfp, 0);
+ return alloc_pages_exact_node(n, gfp, 0);
return alloc_pages(gfp, 0);