[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.