From e78b574cecb3a64df0c2bac2044ac448079c8a87 Mon Sep 17 00:00:00 2001 From: KAMEZAWA Hiroyuki Date: Wed, 18 Feb 2009 14:48:33 -0800 Subject: [PATCH] --- yaml --- r: 131499 b: refs/heads/master c: cc2559bccc72767cb446f79b071d96c30c26439b h: refs/heads/master i: 131497: 0d10c0f13bb30a38d17fe060f593c393846c99cc 131495: 0b62e617ae8413caddab8e0acafa6d0bec617100 v: v3 --- [refs] | 2 +- trunk/arch/ia64/mm/numa.c | 2 +- trunk/include/linux/mmzone.h | 2 +- trunk/mm/page_alloc.c | 23 ++++++++++++++++++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index c320f50a253e..98b91bf3188e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2dbcfa738368c8a40d4a5f0b65dc9879577cb21 +refs/heads/master: cc2559bccc72767cb446f79b071d96c30c26439b diff --git a/trunk/arch/ia64/mm/numa.c b/trunk/arch/ia64/mm/numa.c index 5061c3fb6796..3efea7d0a351 100644 --- a/trunk/arch/ia64/mm/numa.c +++ b/trunk/arch/ia64/mm/numa.c @@ -70,7 +70,7 @@ int __meminit __early_pfn_to_nid(unsigned long pfn) return node_memblk[i].nid; } - return 0; + return -1; } #ifdef CONFIG_MEMORY_HOTPLUG diff --git a/trunk/include/linux/mmzone.h b/trunk/include/linux/mmzone.h index 09c14e213b63..1aca6cebbb78 100644 --- a/trunk/include/linux/mmzone.h +++ b/trunk/include/linux/mmzone.h @@ -1071,7 +1071,7 @@ void sparse_init(void); #endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_NODES_SPAN_OTHER_NODES -#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid)) +bool early_pfn_in_nid(unsigned long pfn, int nid); #else #define early_pfn_in_nid(pfn, nid) (1) #endif diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index c5dd74602efc..5c44ed49ca93 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -3000,16 +3000,33 @@ int __meminit __early_pfn_to_nid(unsigned long pfn) if (start_pfn <= pfn && pfn < end_pfn) return early_node_map[i].nid; } - - return 0; + /* This is a memory hole */ + return -1; } #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ int __meminit early_pfn_to_nid(unsigned long pfn) { - return __early_pfn_to_nid(pfn); + int nid; + + nid = __early_pfn_to_nid(pfn); + if (nid >= 0) + return nid; + /* just returns 0 */ + return 0; } +#ifdef CONFIG_NODES_SPAN_OTHER_NODES +bool __meminit early_pfn_in_nid(unsigned long pfn, int node) +{ + int nid; + + nid = __early_pfn_to_nid(pfn); + if (nid >= 0 && nid != node) + return false; + return true; +} +#endif /* Basic iterator support to walk early_node_map[] */ #define for_each_active_range_index_in_nid(i, nid) \