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-ia64-devel

[Xen-ia64-devel] [patch] small speedup to boot allocator

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch] small speedup to boot allocator
From: Jes Sorensen <jes@xxxxxxx>
Date: Tue, 26 Sep 2006 17:04:22 +0200
Delivery-date: Tue, 26 Sep 2006 08:04:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (X11/20060527)
Hi,

This is a small speedup, but I think it's a good thing to do<tm>.

Jes

Small speedup for the boot allocator to avoid it scanning through a
space which is known to be empty.

Signed-off-by: Jes Sorensen <jes@xxxxxxx>


diff -r 7b250cf49e50 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Sun Sep 24 14:55:57 2006 -0600
+++ b/xen/common/page_alloc.c   Mon Sep 25 18:47:57 2006 +0200
@@ -112,6 +117,7 @@ static void map_alloc(unsigned long firs
     }
 }
 
+static unsigned long first_pg = -1UL;
 
 static void map_free(unsigned long first_page, unsigned long nr_pages)
 {
@@ -128,6 +134,10 @@ static void map_free(unsigned long first
     start_off = first_page & (PAGES_PER_MAPWORD-1);
     end_idx   = (first_page + nr_pages) / PAGES_PER_MAPWORD;
     end_off   = (first_page + nr_pages) & (PAGES_PER_MAPWORD-1);
+
+    if (curr_idx < first_pg)
+        first_pg = curr_idx;
+
 
     if ( curr_idx == end_idx )
     {
@@ -217,7 +229,7 @@ unsigned long alloc_boot_pages(unsigned 
 {
     unsigned long pg, i;
 
-    for ( pg = 0; (pg + nr_pfns) < max_page; pg += pfn_align )
+    for ( pg = first_pg; (pg + nr_pfns) < max_page; pg += pfn_align )
     {
         for ( i = 0; i < nr_pfns; i++ )
             if ( allocated_in_map(pg + i) )
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>