From 950f9d301903cf9eb2f1ee29d0380e11754d9a4c Mon Sep 17 00:00:00 2001 From: Mike Kravetz Date: Fri, 16 Dec 2005 14:30:35 -0800 Subject: [PATCH] --- yaml --- r: 17214 b: refs/heads/master c: b226e462124522f2f23153daff31c311729dfa2f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/mm/numa.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index b62973998cb5..8de5c853633e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 021c73354921a315ae2fceb1ad7807d1569a5a74 +refs/heads/master: b226e462124522f2f23153daff31c311729dfa2f diff --git a/trunk/arch/powerpc/mm/numa.c b/trunk/arch/powerpc/mm/numa.c index fc6f8ee9656f..2863a912bcd0 100644 --- a/trunk/arch/powerpc/mm/numa.c +++ b/trunk/arch/powerpc/mm/numa.c @@ -766,13 +766,15 @@ early_param("numa", early_numa); int hot_add_scn_to_nid(unsigned long scn_addr) { struct device_node *memory = NULL; + nodemask_t nodes; + int numa_domain = 0; if (!numa_enabled || (min_common_depth < 0)) - return 0; + return numa_domain; while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { unsigned long start, size; - int numa_domain, ranges; + int ranges; unsigned int *memcell_buf; unsigned int len; @@ -793,14 +795,21 @@ int hot_add_scn_to_nid(unsigned long scn_addr) if ((scn_addr >= start) && (scn_addr < (start + size))) { of_node_put(memory); - return numa_domain; + goto got_numa_domain; } if (--ranges) /* process all ranges in cell */ goto ha_new_range; } - BUG(); /* section address should be found above */ - return 0; + + /* Temporary code to ensure that returned node is not empty */ +got_numa_domain: + nodes_setall(nodes); + while (NODE_DATA(numa_domain)->node_spanned_pages == 0) { + node_clear(numa_domain, nodes); + numa_domain = any_online_node(nodes); + } + return numa_domain; } #endif /* CONFIG_MEMORY_HOTPLUG */