Skip to contentSkip to conversation

peeling off zone from physical memory layout [7/10] i386 dicontig fix.

RFC New KAMEZAWA Hiroyuki 1 participant 1 message Feb 3, 2006 Memory management

lore
Share & tools
lore
#0 lore raw

RFC 1/1 peeling off zone from physical memory layout [7/10] i386 dicontig fix.

Use for_each_page_in_zone() in i386/mm/discontig.c

arch/i386/mm/discontig.c +4 -14
Index: hogehoge/arch/i386/mm/discontig.c
===================================================================
@@ -31,6 +31,7 @@
 #include <linux/nodemask.h>
 #include <linux/module.h>
 #include <linux/kexec.h>
+#include <linux/memorymap.h>
 
 #include <asm/e820.h>
 #include <asm/setup.h>
@@ -409,26 +410,15 @@ void __init set_highmem_pages_init(int b
 #ifdef CONFIG_HIGHMEM
 	struct zone *zone;
 	struct page *page;
+	void *iter;
 
 	for_each_zone(zone) {
 		unsigned long node_pfn, zone_start_pfn, zone_end_pfn;
 
 		if (!is_highmem(zone))
 			continue;
-
-		zone_start_pfn = zone->zone_start_pfn;
-		zone_end_pfn = zone_start_pfn + zone->spanned_pages;
-
-		printk("Initializing %s for node %d (%08lx:%08lx)\n",
-				zone->name, zone->zone_pgdat->node_id,
-				zone_start_pfn, zone_end_pfn);
-
-		for (node_pfn = zone_start_pfn; node_pfn < zone_end_pfn; node_pfn++) {
-			if (!pfn_valid(node_pfn))
-				continue;
-			page = pfn_to_page(node_pfn);
-			add_one_highpage_init(page, node_pfn, bad_ppro);
-		}
+		for_each_page_in_zone(page, zone , iter)
+			add_one_highpage_init(page, page_to_pfn(page), bad_ppro);
 	}
 	totalram_pages += totalhigh_pages;
 #endif

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>