From: Andi Kleen Date: Wed, 11 Jan 2006 21:43:45 +0000 (+0100) Subject: [PATCH] x86_64: Handle unknown node (-1) in alloc_pages_node X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=819a692804a8d2d42b7bb033d2650dba47622149;p=openwrt%2Fstaging%2Fblogic.git [PATCH] x86_64: Handle unknown node (-1) in alloc_pages_node Following kmalloc_node. Needed for another patch to return -1 for unknown nodes in x86-64. Cc: Christoph Lameter Cc: kiran@scalex86.org Signed-off-by: Andi Kleen [ Changed 0 to numa_node_id() on suggestion by Christoph Lameter ] Signed-off-by: Linus Torvalds --- diff --git a/include/linux/gfp.h b/include/linux/gfp.h index da7ce8730e97..20f9148e38d9 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -110,6 +110,10 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, if (unlikely(order >= MAX_ORDER)) return NULL; + /* Unknown node is current node */ + if (nid < 0) + nid = numa_node_id(); + return __alloc_pages(gfp_mask, order, NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); }