From: "Jan Beulich" Subject: [PATCH] linux/x86: fix GFP mask handling in dma_alloc_coherent() Date: Thu, 22 Oct 2009 12:49:25 +0100 Message-ID: <4AE062E5020000780001B49F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 --- 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; =20 /* ignore region specifiers */ - gfp &=3D ~(__GFP_DMA | __GFP_HIGHMEM); + gfp &=3D ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); =20 if (mem) { int page =3D bitmap_find_free_region(mem->bitmap, = mem->size, @@ -213,9 +213,6 @@ void *dma_alloc_coherent(struct device * return NULL; } =20 - if (dev =3D=3D NULL || (dev->coherent_dma_mask < 0xffffffff)) - gfp |=3D GFP_DMA; - vstart =3D __get_free_pages(gfp, order); ret =3D (void *)vstart; =20