lkml.org 
[lkml]   [2008]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateWed, 3 Sep 2008 22:11:39 +0200
FromJoerg Roedel <>
SubjectRe: [PATCH] swiotlb: fix dma_alloc_coherent allocation failures with swiotlb
On Wed, Sep 03, 2008 at 09:54:15PM +0200, Joerg Roedel wrote:
> On Thu, Sep 04, 2008 at 03:05:21AM +0900, FUJITA Tomonori wrote:
> > On Wed, 3 Sep 2008 17:03:44 +0200
> > Joerg Roedel <joerg.roedel@amd.com> wrote:
> >
> > > The SWIOTLB version of dma_alloc_coherent allocates all memory with
> > > GFP_DMA unconditionally. This leads sometimes unnecessary to allocation
> > > failures. This patch makes the allocation strategy to use the DMA32 zone
> > > first if this is possible. The changes are boot tested on AMD64 and
> > > compile tested for i386 and IA64.
> > >
> > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > > Cc: tony.luck@intel.com
> > > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> > > ---
> > > lib/swiotlb.c | 23 +++++++++++++++++------
> > > 1 files changed, 17 insertions(+), 6 deletions(-)
> >
> > This doesn't look correct since IA64 doesn't need this flag hack.
>
> Thats why the patch checks the DMA mask against ISA_DMA_THRESHOLD. This
> is defined as the border of the ZONE_DMA (16MB on x86 and 4G on IA64).
> So is correct for x86 and ia64.
>
> > Another problem about this patch is that swiotlb doesn't use GFP_DMA
> > for the fallback_dev.
>
> Thats not true, it does. ISA_DMA_THRESHOLD is defined to be the same as
> DMA_24BIT_MASK, which is the DMA mask of the fallback_dev.

(on x86, which defines the fallback_dev)

>
> Joerg
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/iommu


\
 
 \ /
  Last update: 2008-09-03 22:13    [from the cache]
©2003-2010