]> err.no Git - linux-2.6/commitdiff
[PATCH] x86_64: Handle unknown node (-1) in alloc_pages_node
authorAndi Kleen <ak@suse.de>
Wed, 11 Jan 2006 21:43:45 +0000 (22:43 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 03:04:51 +0000 (19:04 -0800)
Following kmalloc_node.

Needed for another patch to return -1 for unknown nodes in x86-64.

Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: kiran@scalex86.org
Signed-off-by: Andi Kleen <ak@suse.de>
[ Changed 0 to numa_node_id() on suggestion by Christoph Lameter ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/gfp.h

index da7ce8730e97d33e383b24971a7c03c9aa285c8a..20f9148e38d930e23d33c8c80376c7e6018ea9e0 100644 (file)
@@ -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));
 }