|
|
|
|
|
|
|
|
|
|
xen-ia64-devel
[Xen-ia64-devel] [patch] small speedup to boot allocator
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>
|
- [Xen-ia64-devel] [patch] small speedup to boot allocator,
Jes Sorensen <=
|
|
|
|
|