bitkeeper revision 1.1159.258.27 (422ddcd5Cf-97FdGP6TJyFvIxer4Mg)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Mar 2005 17:11:49 +0000 (17:11 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Mar 2005 17:11:49 +0000 (17:11 +0000)
Prevent buddy-allocator merges across Xen/Domain zones boundary.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
xen/common/page_alloc.c

index 1790e3520ddffcccbcce82e2d25bcbe34eb028dc..d8ac2d4ca05a5188f6aa7ce30885fe4e8f685d41 100644 (file)
@@ -392,6 +392,13 @@ void init_xenheap_pages(unsigned long ps, unsigned long pe)
 
     memguard_guard_range(__va(ps), pe - ps);
 
+    /*
+     * Yuk! Ensure there is a one-page buffer between Xen and Dom zones, to
+     * prevent merging of power-of-two blocks across the zone boundary.
+     */
+    if ( !IS_XEN_HEAP_FRAME(phys_to_page(pe)) )
+        pe -= PAGE_SIZE;
+
     local_irq_save(flags);
     init_heap_pages(MEMZONE_XEN, phys_to_page(ps), (pe - ps) >> PAGE_SHIFT);
     local_irq_restore(flags);