]> xenbits.xensource.com Git - xen.git/commitdiff
xen: Fix numa=on boot.
authorKeir Fraser <keir@xensource.com>
Sat, 31 Mar 2007 11:20:31 +0000 (12:20 +0100)
committerKeir Fraser <keir@xensource.com>
Sat, 31 Mar 2007 11:20:31 +0000 (12:20 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/setup.c
xen/common/page_alloc.c

index 446c42f3d93194c073df1b5d9be4d55aa09a18e5..1e58905523315cf16e207b40b5d9d699ae004a32 100644 (file)
@@ -591,8 +591,6 @@ void __init __start_xen(multiboot_info_t *mbi)
 
     numa_initmem_init(0, max_page);
 
-    end_boot_allocator();
-
     /* Initialise the Xen heap, skipping RAM holes. */
     nr_pages = 0;
     for ( i = 0; i < e820.nr_map; i++ )
@@ -618,6 +616,8 @@ void __init __start_xen(multiboot_info_t *mbi)
            nr_pages >> (20 - PAGE_SHIFT),
            nr_pages << (PAGE_SHIFT - 10));
 
+    end_boot_allocator();
+
     early_boot = 0;
 
     early_cpu_init();
index b6e0afb1743d875471790f97d96d1a11ef291e85..bda9931e921e8ade6ec8cfe060bf1cdba1e19cd2 100644 (file)
@@ -512,6 +512,14 @@ void init_heap_pages(
 
     ASSERT(zone < NR_ZONES);
 
+    if ( unlikely(avail[0] == NULL) )
+    {
+        /* Start-of-day memory node 0 initialisation. */
+        init_heap_block(&_heap0);
+        _heap[0] = &_heap0;
+        avail[0] = avail0;
+    }
+
     if ( likely(page_to_mfn(pg) != 0) )
         nid_prev = phys_to_nid(page_to_maddr(pg-1));
     else
@@ -570,10 +578,6 @@ void end_boot_allocator(void)
     unsigned long i;
     int curr_free, next_free;
 
-    init_heap_block(&_heap0);
-    _heap[0] = &_heap0;
-    avail[0] = avail0;
-
     /* Pages that are free now go to the domain sub-allocator. */
     if ( (curr_free = next_free = !allocated_in_map(first_valid_mfn)) )
         map_alloc(first_valid_mfn, 1);