diff options
author | Mel Gorman <mel@csn.ul.ie> | 2009-06-16 18:31:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:32 -0400 |
commit | 6484eb3e2a81807722c5f28efef94d8338b7b996 (patch) | |
tree | 10ce36f412c2ff0c7eb399af1a189f8e354f56db /drivers/misc | |
parent | b3c466ce512923298ae8c0121d3e9f397a3f1210 (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 <mel@csn.ul.ie>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Paul Mundt <lethal@linux-sh.org> [for the SLOB NUMA bits]
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/sgi-gru/grufile.c | 2 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_uv.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index bbefe77c67a9..3ce2920e2bf3 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -302,7 +302,7 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr) | |||
302 | pnode = uv_node_to_pnode(nid); | 302 | pnode = uv_node_to_pnode(nid); |
303 | if (bid < 0 || gru_base[bid]) | 303 | if (bid < 0 || gru_base[bid]) |
304 | continue; | 304 | continue; |
305 | page = alloc_pages_node(nid, GFP_KERNEL, order); | 305 | page = alloc_pages_exact_node(nid, GFP_KERNEL, order); |
306 | if (!page) | 306 | if (!page) |
307 | goto fail; | 307 | goto fail; |
308 | gru_base[bid] = page_address(page); | 308 | gru_base[bid] = page_address(page); |
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 9172fcdee4e2..c76677afda1b 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -232,7 +232,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, | |||
232 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); | 232 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); |
233 | 233 | ||
234 | nid = cpu_to_node(cpu); | 234 | nid = cpu_to_node(cpu); |
235 | page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, | 235 | page = alloc_pages_exact_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, |
236 | pg_order); | 236 | pg_order); |
237 | if (page == NULL) { | 237 | if (page == NULL) { |
238 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " | 238 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " |