aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2009-02-18 17:48:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-18 18:37:55 -0500
commitcc2559bccc72767cb446f79b071d96c30c26439b (patch)
treeaacdeee5368e0eef72ed1d7a7cbd7e6ee4837941 /mm
parentf2dbcfa738368c8a40d4a5f0b65dc9879577cb21 (diff)
mm: fix memmap init for handling memory hole
Now, early_pfn_in_nid(PFN, NID) may returns false if PFN is a hole. and memmap initialization was not done. This was a trouble for sparc boot. To fix this, the PFN should be initialized and marked as PG_reserved. This patch changes early_pfn_in_nid() return true if PFN is a hole. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reported-by: David Miller <davem@davemlloft.net> Tested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: <stable@kernel.org> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c5dd74602efc..5c44ed49ca93 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3000,16 +3000,33 @@ int __meminit __early_pfn_to_nid(unsigned long pfn)
3000 if (start_pfn <= pfn && pfn < end_pfn) 3000 if (start_pfn <= pfn && pfn < end_pfn)
3001 return early_node_map[i].nid; 3001 return early_node_map[i].nid;
3002 } 3002 }
3003 3003 /* This is a memory hole */
3004 return 0; 3004 return -1;
3005} 3005}
3006#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 3006#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
3007 3007
3008int __meminit early_pfn_to_nid(unsigned long pfn) 3008int __meminit early_pfn_to_nid(unsigned long pfn)
3009{ 3009{
3010 return __early_pfn_to_nid(pfn); 3010 int nid;
3011
3012 nid = __early_pfn_to_nid(pfn);
3013 if (nid >= 0)
3014 return nid;
3015 /* just returns 0 */
3016 return 0;
3011} 3017}
3012 3018
3019#ifdef CONFIG_NODES_SPAN_OTHER_NODES
3020bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
3021{
3022 int nid;
3023
3024 nid = __early_pfn_to_nid(pfn);
3025 if (nid >= 0 && nid != node)
3026 return false;
3027 return true;
3028}
3029#endif
3013 3030
3014/* Basic iterator support to walk early_node_map[] */ 3031/* Basic iterator support to walk early_node_map[] */
3015#define for_each_active_range_index_in_nid(i, nid) \ 3032#define for_each_active_range_index_in_nid(i, nid) \