From 685517654adcb217db9361f326a682545db1a811 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 27 Jul 2007 15:44:07 -0400 Subject: [PATCH] Uncached allocator: Handle memoryless nodes The checks for node_online in the uncached allocator are made to make sure that memory is available on these nodes. Thus switch all the checks to use N_HIGH_MEMORY and to N_ONLINE. Signed-off-by: Christoph Lameter Signed-off-by: Jes Sorensen Acked-by: Lee Schermerhorn Acked-by: Bob Picco --- arch/ia64/kernel/uncached.c | 4 ++-- drivers/char/mspec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6/arch/ia64/kernel/uncached.c =================================================================== --- linux-2.6.orig/arch/ia64/kernel/uncached.c 2007-07-31 21:08:00.000000000 -0700 +++ linux-2.6/arch/ia64/kernel/uncached.c 2007-07-31 21:22:00.000000000 -0700 @@ -196,7 +196,7 @@ unsigned long uncached_alloc_page(int st nid = starting_nid; do { - if (!node_online(nid)) + if (!node_state(nid, N_HIGH_MEMORY)) continue; uc_pool = &uncached_pools[nid]; if (uc_pool->pool == NULL) @@ -268,7 +268,7 @@ static int __init uncached_init(void) { int nid; - for_each_online_node(nid) { + for_each_node_state(nid, N_ONLINE) { uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid); mutex_init(&uncached_pools[nid].add_chunk_mutex); } Index: linux-2.6/drivers/char/mspec.c =================================================================== --- linux-2.6.orig/drivers/char/mspec.c 2007-07-31 21:08:00.000000000 -0700 +++ linux-2.6/drivers/char/mspec.c 2007-07-31 21:21:30.000000000 -0700 @@ -345,7 +345,7 @@ mspec_init(void) is_sn2 = 1; if (is_shub2()) { ret = -ENOMEM; - for_each_online_node(nid) { + for_each_node_state(nid, N_ONLINE) { int actual_nid; int nasid; unsigned long phys;