


---

 memhotplug-dave/mm/memory_hotplug.c |   12 ++++++++++++
 memhotplug-dave/mm/page_alloc.c     |    7 ++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff -puN mm/memory_hotplug.c~P-i386-debug mm/memory_hotplug.c
--- memhotplug/mm/memory_hotplug.c~P-i386-debug	Thu Aug  5 09:41:19 2004
+++ memhotplug-dave/mm/memory_hotplug.c	Thu Aug  5 09:41:19 2004
@@ -54,22 +54,31 @@ int __add_pages(struct zone *zone, unsig
 	unsigned long base_pfn;
 	int i, err;
 
+	printk("%s(%p, %lx, %ld, %ld)\n", __func__, zone, phys_start_pfn, nr_pages, attr);
+
 	base_pfn = zone->zone_start_pfn + zone->present_pages;
 
+	printk("%s() 1\n", __func__);
 	alloc_memsections(base_pfn, phys_start_pfn, nr_pages);
 
+	printk("%s() 2\n", __func__);
 	memmap = __kmalloc_section_memmap(nr_pages);
 	if (!memmap)
 		return -ENOMEM;
 
+	printk("%s() 3\n", __func__);
 	err = zone_grow_free_lists(zone, zone->spanned_pages + nr_pages);
 	if (err) {
 		kfree(memmap);
 		return -1;
 	}
 
+	printk("%s() 4\n", __func__);
 	alloc_memmap(memmap, base_pfn, nr_pages);
+	printk("%s() 5\n", __func__);
+	printk("\tpgdat: %p\n", pgdat);
 	memmap_init_zone(nr_pages, 0, zone - pgdat->node_zones, phys_start_pfn);
+	printk("%s() 6\n", __func__);
 
 	/* Hmm, our use of zone->present_pages above either a) needs to change
 	 * or b) needs to mean that "pages that are present, BUT not necessarily
@@ -83,10 +92,13 @@ int __add_pages(struct zone *zone, unsig
 	 * onlined from user space.
 	 */
 
+	printk("%s() 7\n", __func__);
 	for (i = 0; i < nr_pages; i += SECTION_SIZE, base_pfn += SECTION_SIZE) {
 		unsigned int section = pfn_to_section(base_pfn);
+	printk("%s() 8\n", __func__);
 		register_new_memory(section);
 	}
+	printk("%s() 9\n", __func__);
 
 	return 0;
 }
diff -puN mm/page_alloc.c~P-i386-debug mm/page_alloc.c
--- memhotplug/mm/page_alloc.c~P-i386-debug	Thu Aug  5 09:41:19 2004
+++ memhotplug-dave/mm/page_alloc.c	Thu Aug  5 09:41:19 2004
@@ -1389,8 +1389,12 @@ static void __init calculate_zone_totalp
 void __devinit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 		unsigned long start_pfn)
 {
-	struct page *start = pfn_to_page(start_pfn);
+	struct page *start;
 	struct page *page;
+	
+	printk("%s() 0\n", __func__);
+	start = pfn_to_page(start_pfn);
+	printk("%s() 1\n", __func__);
 
 	for (page = start; page < (start + size); page++) {
 		set_page_zone(page, NODEZONE(nid, zone));
@@ -1404,6 +1408,7 @@ void __devinit memmap_init_zone(unsigned
 #endif
 		start_pfn++;
 	}
+	printk("%s() 2\n", __func__);
 }
 
 /*

_
