<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
Signed-off-by: Dave Hansen &lt;haveblue@us.ibm.com&gt;
---

 memhotplug-dave/mm/page_alloc.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff -puN mm/page_alloc.c~K6-capture-pages-cleanup mm/page_alloc.c
--- memhotplug/mm/page_alloc.c~K6-capture-pages-cleanup	2004-12-08 14:57:23.000000000 -0800
+++ memhotplug-dave/mm/page_alloc.c	2004-12-08 14:57:23.000000000 -0800
@@ -714,13 +714,9 @@ int capture_page_range(unsigned long sta
 	int fup;
 	struct page *page;
 	int i;
-	unsigned long nr_pages;
+	unsigned long nr_pages = 1&lt;&lt;order;
 
-	/* If the start_pfn is not aligned with the order return failure */
-	if (start_pfn % (1 &lt;&lt; order) != 0)
-		return -EINVAL;
-
-	for (i = 0; i &lt; (1 &lt;&lt; order); i++)
+	for (i = 0; i &lt; nr_pages; i++)
 		set_page_under_capture(pfn_to_page(start_pfn + i));
 	/*
 	 * the set_page_under_capture() operations are not barriers, so
@@ -737,16 +733,14 @@ int capture_page_range(unsigned long sta
 	page = pfn_to_page(start_pfn);
 	remove_page_freearea(page, order);
 	force_captured_to_inactive_list(page);
-	nr_pages = 1&lt;&lt;order;
 	/*
 	 * storing the last result (fp) keeps up from having
 	 * to walk the entire range each time
 	 */
 	fup = start_pfn;
-	while((fup = first_uncaptured_page(fup, nr_pages)) &gt;= 0) {
-		if (i++ &lt; 100)
-			while (shrink_all_memory(10000));
-		msleep(100);
+	while((fup = first_uncaptured_page(fup, nr_pages - (fup - start_pfn))) &gt;= 0) {
+		while (shrink_all_memory(10000));
+		msleep(1000);
 	}
 
 	return 0;
_
</pre></body></html>