]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen: swiotlb allocations do not need to come from low memory
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 20 Mar 2009 09:00:58 +0000 (09:00 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 20 Mar 2009 09:00:58 +0000 (09:00 +0000)
Other than on native, where using the _low variants of alloc_bootmem()
is indeed a requirement for swiotlb, on Xen this is not needed. Using
the _low variants has the potential of preventing systems from booting
when they have lots of memory, due to the way the bootmem allocator
works: It allocates memory from bottom to top. Thus, if other large
(but not _low) allocations (memmap, large system hash tables)
mostly consume the memory below 4Gb, the swiotlb allocations can
fail. (This is equally so for native, but cannot be that easily fixed
there.)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
lib/swiotlb-xen.c

index 59a757b0218df1ee0308eccfb5a6954c8afe70e9..166ff7219402245a4c8245300371e7e0b252c7fb 100644 (file)
@@ -151,7 +151,7 @@ swiotlb_init_with_default_size (size_t default_size)
        /*
         * Get IO TLB memory from the low pages
         */
-       iotlb_virt_start = alloc_bootmem_low_pages(bytes);
+       iotlb_virt_start = alloc_bootmem_pages(bytes);
        if (!iotlb_virt_start)
                panic("Cannot allocate SWIOTLB buffer!\n");
 
@@ -196,7 +196,7 @@ swiotlb_init_with_default_size (size_t default_size)
        /*
         * Get the overflow emergency buffer
         */
-       io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
+       io_tlb_overflow_buffer = alloc_bootmem(io_tlb_overflow);
        if (!io_tlb_overflow_buffer)
                panic("Cannot allocate SWIOTLB overflow buffer!\n");