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] [xen-unstable] page_alloc: properly honor MAX_ORDER in i

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] page_alloc: properly honor MAX_ORDER in init_heap_pages()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Feb 2009 20:50:56 -0800
Delivery-date: Tue, 03 Feb 2009 20:51:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1233314063 0
# Node ID 9b9078a02f65fc010ad838de1c9c4e8aa4cf1009
# Parent  e1135b40e783e965ed4eccfd8e983e9f3f4259e8
page_alloc: properly honor MAX_ORDER in init_heap_pages()

The previous check was flawed in that it checked
- for a single bit to be set instead of a range of bits to be clear
- a machine address against a mask supposed to be used on MFNs.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/common/page_alloc.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff -r e1135b40e783 -r 9b9078a02f65 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Fri Jan 30 11:13:55 2009 +0000
+++ b/xen/common/page_alloc.c   Fri Jan 30 11:14:23 2009 +0000
@@ -479,7 +479,6 @@ static void free_heap_pages(
  * latter is not on a MAX_ORDER boundary, then we reserve the page by
  * not freeing it to the buddy allocator.
  */
-#define MAX_ORDER_ALIGNED (1UL << (MAX_ORDER))
 static void init_heap_pages(
     struct page_info *pg, unsigned long nr_pages)
 {
@@ -496,15 +495,15 @@ static void init_heap_pages(
             init_node_heap(nid_curr);
 
         /*
-         * free pages of the same node, or if they differ, but are on a
-         * MAX_ORDER alignement boundary (which already get reserved)
+         * Free pages of the same node, or if they differ, but are on a
+         * MAX_ORDER alignment boundary (which already get reserved).
          */
-         if ( (nid_curr == nid_prev) || (page_to_maddr(pg+i) &
-                                         MAX_ORDER_ALIGNED) )
-             free_heap_pages(pg+i, 0);
-         else
-             printk("Reserving non-aligned node boundary @ mfn %lu\n",
-                    page_to_mfn(pg+i));
+        if ( (nid_curr == nid_prev) ||
+             !(page_to_mfn(pg+i) & ((1UL << MAX_ORDER) - 1)) )
+            free_heap_pages(pg+i, 0);
+        else
+            printk("Reserving non-aligned node boundary @ mfn %#lx\n",
+                   page_to_mfn(pg+i));
 
         nid_prev = nid_curr;
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] page_alloc: properly honor MAX_ORDER in init_heap_pages(), Xen patchbot-unstable <=