WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fixes to sub 4GB allocator

# HG changeset patch
# User iap10@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1f4863861d18ded485b5f126d592e2aad87a831d
# Parent  c2705e74efbaba2bf1867a7391e6b76225dd10f9
Fixes to sub 4GB allocator
Signed-off-by: ian@xxxxxxxxxxxxx

diff -r c2705e74efba -r 1f4863861d18 xen/common/memory.c
--- a/xen/common/memory.c       Thu Sep  8 15:22:01 2005
+++ b/xen/common/memory.c       Thu Sep  8 17:35:44 2005
@@ -154,7 +154,8 @@
         reservation.nr_extents -= start_extent;
 
         if ( (reservation.address_bits != 0) &&
-             (reservation.address_bits < (get_order(max_page) + PAGE_SHIFT)) )
+             (reservation.address_bits <
+              (get_order_from_pages(max_page) + PAGE_SHIFT)) )
         {
             if ( reservation.address_bits < 31 )
                 return -ENOMEM;
diff -r c2705e74efba -r 1f4863861d18 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h        Thu Sep  8 15:22:01 2005
+++ b/xen/include/asm-x86/page.h        Thu Sep  8 17:35:44 2005
@@ -280,7 +280,7 @@
 
 #ifndef __ASSEMBLY__
 
-static __inline__ int get_order(unsigned long size)
+static inline int get_order_from_bytes(physaddr_t size)
 {
     int order;
     size = (size-1) >> PAGE_SHIFT;
@@ -288,6 +288,17 @@
         size >>= 1;
     return order;
 }
+
+static inline int get_order_from_pages(unsigned long nr_pages)
+{
+    int order;
+    nr_pages--;
+    for ( order = 0; nr_pages; order++ )
+        nr_pages >>= 1;
+    return order;
+}
+
+#define get_order(s) get_order_from_bytes(s)
 
 /* Allocator functions for Xen pagetables. */
 struct pfn_info *alloc_xen_pagetable(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fixes to sub 4GB allocator, Xen patchbot -unstable <=