Signed-off-by: Dave Hansen --- memhotplug-dave/mm/page_alloc.c | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff -puN mm/page_alloc.c~K5-compile-fixes mm/page_alloc.c --- memhotplug/mm/page_alloc.c~K5-compile-fixes 2005-07-28 13:51:12.000000000 -0700 +++ memhotplug-dave/mm/page_alloc.c 2005-07-28 13:51:12.000000000 -0700 @@ -402,7 +402,7 @@ static inline void extract_pages(struct area->nr_free--; } -#ifdef CONFIG_MEMORY_HOTPLUG +#ifdef CONFIG_MEMORY_REMOVE /* * Called when trying to allocate or free a page that has been marked for * removal. @@ -473,7 +473,7 @@ static int remove_page_freearea(struct p static inline void capture_pages(struct page *page, int order) { } -#endif /* CONFIG_MEMORY_HOTPLUG */ +#endif /* CONFIG_MEMORY_REMOVE */ void __free_pages_ok(struct page *page, unsigned int order) { @@ -662,7 +662,7 @@ void drain_remote_pages(void) } #endif -#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_MEMORY_HOTPLUG) +#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_MEMORY_REMOVE) static void __drain_pages(unsigned int cpu) { struct zone *zone; @@ -681,7 +681,7 @@ static void __drain_pages(unsigned int c } } } -#endif /* CONFIG_PM || CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_HOTPLUG */ +#endif /* CONFIG_PM || CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_REMOVE */ #ifdef CONFIG_PM @@ -711,7 +711,7 @@ void mark_free_pages(struct zone *zone) } #endif /* CONFIG_PM */ -#if defined(CONFIG_PM) || defined(CONFIG_MEMORY_HOTPLUG) +#if defined(CONFIG_PM) || defined(CONFIG_MEMORY_REMOVE) /* * Spill all of this CPU's per-cpu pages back into the buddy allocator. @@ -724,14 +724,15 @@ void drain_local_pages(void) __drain_pages(smp_processor_id()); local_irq_restore(flags); } -#endif /* CONFIG_PM || CONFIG_MEMORY_HOTPLUG */ +#endif /* CONFIG_PM || CONFIG_MEMORY_REMOVE */ -#ifdef CONFIG_MEMORY_HOTPLUG +#ifdef CONFIG_MEMORY_REMOVE static inline int first_uncaptured_page(unsigned long start_pfn, int nr_pages) { int i; int res = -1; - int count = 0;; + int count = 0; + unsigned long end_pfn = start_pfn + nr_pages; printk(KERN_DEBUG "%s(%ld, %d) begin\n", __func__, start_pfn, nr_pages); @@ -791,7 +792,6 @@ int capture_page_range(unsigned long sta struct page *page; int i; unsigned long nr_pages; - unsigned long end_pfn; /* If the start_pfn is not aligned with the order return failure */ if (start_pfn % (1 << order) != 0) @@ -820,8 +820,7 @@ int capture_page_range(unsigned long sta * to walk the entire range each time */ fup = start_pfn; - end_pfn = start_pfn + nr_pages; - while((fp = first_uncaptured_page(fup, end_pfn)) >= 0) { + while((fup = first_uncaptured_page(fup, nr_pages)) >= 0) { if (i++ < 100) while (shrink_all_memory(10000)); msleep(100); @@ -830,12 +829,12 @@ int capture_page_range(unsigned long sta return 0; } -#else /* CONFIG_MEMORY_HOTPLUG */ -int capture_page_range(unsigned long pfn, unsigned long size) +#else /* CONFIG_MEMORY_REMOVE */ +int capture_page_range(unsigned long pfn, int order) { return -ENOSYS; } -#endif /* CONFIG_MEMORY_HOTPLUG */ +#endif /* CONFIG_MEMORY_REMOVE */ static void zone_statistics(struct zonelist *zonelist, struct zone *z) { _