WARNING - OLD ARCHIVES

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

xen-devel

[Xen-devel] [PATCH] linux/x86: fix GFP mask handling in dma_alloc_cohere

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: fix GFP mask handling in dma_alloc_coherent()
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 22 Oct 2009 12:49:25 +0100
Delivery-date: Thu, 22 Oct 2009 04:48:54 -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
Ever since no longer pushing all memory into the DMA zone (c/s 355),
explicitly setting GFP_DMA as well as not masking off GFP_DMA32 was
unnecessarily restricting the pool from which suitable memory could be
taken.

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

--- sle10sp3-2009-10-19.orig/arch/i386/kernel/pci-dma-xen.c     2009-06-22 
11:20:42.000000000 +0200
+++ sle10sp3-2009-10-19/arch/i386/kernel/pci-dma-xen.c  2009-10-22 
12:32:19.000000000 +0200
@@ -198,7 +198,7 @@ void *dma_alloc_coherent(struct device *
        u64 mask;
 
        /* ignore region specifiers */
-       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
+       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
 
        if (mem) {
                int page = bitmap_find_free_region(mem->bitmap, mem->size,
@@ -213,9 +213,6 @@ void *dma_alloc_coherent(struct device *
                        return NULL;
        }
 
-       if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
-
        vstart = __get_free_pages(gfp, order);
        ret = (void *)vstart;
 




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: fix GFP mask handling in dma_alloc_coherent(), Jan Beulich <=