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/
Home Products Support Community News


[Xen-devel] [PATCH] linux: swiotlb allocations do not need to come from

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: swiotlb allocations do not need to come from low memory
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 20 Mar 2009 07:56:39 +0000
Delivery-date: Fri, 20 Mar 2009 00:56:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

As usual, written and tested on 2.6.27.x and made apply to the 2.6.18
tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- head-2009-03-18.orig/lib/swiotlb-xen.c      2009-03-18 16:08:59.000000000 
+++ head-2009-03-18/lib/swiotlb-xen.c   2009-03-18 16:09:12.000000000 +0100
@@ -173,7 +173,7 @@ __setup("swiotlb=", setup_io_tlb_npages)
         * 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");
@@ -217,7 +217,7 @@ swiotlb_init_with_default_size(size_t de
         * 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");

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: swiotlb allocations do not need to come from low memory, Jan Beulich <=