<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Oracle bug 8300888
The balloon code needs to adjust totalhigh_pages
5/8/2009 Chuck Anderson

The balloon code needs to adjust the global kernel symbol totalhigh_pages 
when it adds/removes pages from/to high memory.  Otherwise, totalhigh_pages
will not represent the number of pages in high memory.
diff -up linux-2.6.18.i686/drivers/xen/balloon/balloon.c.orig linux-2.6.18.i686/drivers/xen/balloon/balloon.c
--- linux-2.6.18.i686/drivers/xen/balloon/balloon.c.orig	2009-03-06 14:56:53.000000000 -0800
+++ linux-2.6.18.i686/drivers/xen/balloon/balloon.c	2009-03-08 22:15:01.000000000 -0700
@@ -92,6 +92,7 @@ static unsigned long frame_list[PAGE_SIZ
 
 /* VM /proc information for memory */
 extern unsigned long totalram_pages;
+extern unsigned long totalhigh_pages;
 
 /* We may hit the hard limit in Xen. If we do then we remember it. */
 static unsigned long hard_limit;
@@ -137,6 +138,7 @@ static void balloon_append(struct page *
 	if (PageHighMem(page)) {
 		list_add_tail(PAGE_TO_LIST(page), &amp;ballooned_pages);
 		balloon_high++;
+		totalhigh_pages--;
 	} else {
 		list_add(PAGE_TO_LIST(page), &amp;ballooned_pages);
 		balloon_low++;
@@ -154,10 +156,13 @@ static struct page *balloon_retrieve(voi
 	page = LIST_TO_PAGE(ballooned_pages.next);
 	UNLIST_PAGE(page);
 
-	if (PageHighMem(page))
+	if (PageHighMem(page)) {
 		balloon_high--;
-	else
+		totalhigh_pages++;
+	}
+	else {
 		balloon_low--;
+	}
 
 	return page;
 }
@@ -612,6 +617,9 @@ struct page **alloc_empty_pages_and_page
 		}
 
 		totalram_pages = --current_pages;
+		if (PageHighMem(page)) {
+			totalhigh_pages--;
+		}
 
 		balloon_unlock(flags);
 	}
diff -up linux-2.6.18.i686/mm/page_alloc.c.orig linux-2.6.18.i686/mm/page_alloc.c
--- linux-2.6.18.i686/mm/page_alloc.c.orig	2009-03-08 20:36:33.000000000 -0700
+++ linux-2.6.18.i686/mm/page_alloc.c	2009-03-08 20:49:47.000000000 -0700
@@ -72,6 +72,7 @@ static void __free_pages_ok(struct page 
 int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 };
 
 EXPORT_SYMBOL(totalram_pages);
+EXPORT_SYMBOL(totalhigh_pages);
 
 /*
  * Used by page_zone() to look up the address of the struct zone whose
</pre></body></html>