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] Re: [patch] small speedup to boot allocator

To: Jes Sorensen <jes@xxxxxxx>
Subject: [Xen-ia64-devel] Re: [patch] small speedup to boot allocator
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 26 Sep 2006 16:19:55 -0600
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 26 Sep 2006 15:20:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45194176.1090100@xxxxxxx>
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>
Organization: OSLO R&D
References: <45194176.1090100@xxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2006-09-26 at 17:04 +0200, Jes Sorensen wrote:
> Hi,
> 
> This is a small speedup, but I think it's a good thing to do<tm>.

Hi Jes,

   Looks good to me, but this needs to go to xen-devel since it's common
code.  Thanks,

        Alex

> plain text document attachment (boot-alloc-speed.diff)
> Small speedup for the boot allocator to avoid it scanning through a
> space which is known to be empty.

> 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) )
-- 
Alex Williamson                             HP Open Source & Linux Org.


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

<Prev in Thread] Current Thread [Next in Thread>