gru: handle blades without memory
authorJack Steiner <steiner@sgi.com>
Wed, 16 Dec 2009 00:48:03 +0000 (16:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Dec 2009 15:20:14 +0000 (07:20 -0800)
Do not use alloc_pages_exact_node() to allocate GRU tables.  If a blade
has no local memory, nid will be -1.  Use alloc_pages_node() instead.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/misc/sgi-gru/grufile.c

index 6318ee5c8d505fca081251aa940fff02cbc28fcd..2e574fd5d3f76e904a0640cc888b46245f5b509a 100644 (file)
@@ -266,8 +266,8 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
        max_user_dsr_bytes = GRU_NUM_DSR_BYTES;
        for_each_possible_blade(bid) {
                pnode = uv_blade_to_pnode(bid);
-               nid = uv_blade_to_memory_nid(bid);
-               page = alloc_pages_exact_node(nid, GFP_KERNEL, order);
+               nid = uv_blade_to_memory_nid(bid);/* -1 if no memory on blade */
+               page = alloc_pages_node(nid, GFP_KERNEL, order);
                if (!page)
                        goto fail;
                gru_base[bid] = page_address(page);