page allocator: do not check NUMA node ID when the caller knows the node is valid
authorMel Gorman <mel@csn.ul.ie>
Tue, 16 Jun 2009 22:31:54 +0000 (15:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:32 +0000 (19:47 -0700)
commit6484eb3e2a81807722c5f28efef94d8338b7b996
tree10ce36f412c2ff0c7eb399af1a189f8e354f56db
parentb3c466ce512923298ae8c0121d3e9f397a3f1210
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>
17 files changed:
arch/ia64/hp/common/sba_iommu.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/uncached.c
arch/ia64/sn/pci/pci_dma.c
arch/powerpc/platforms/cell/ras.c
arch/x86/kvm/vmx.c
drivers/misc/sgi-gru/grufile.c
drivers/misc/sgi-xp/xpc_uv.c
include/linux/gfp.h
include/linux/mm.h
kernel/profile.c
mm/filemap.c
mm/hugetlb.c
mm/mempolicy.c
mm/migrate.c
mm/slab.c
mm/slob.c