lkml.org 
[lkml]   [2008]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] swiotlb: fix dma_alloc_coherent allocation failures with swiotlb
From
On Thu, 4 Sep 2008 10:05:28 +0200
Andi Kleen <andi@firstfloor.org> wrote:

> On Thu, Sep 04, 2008 at 04:58:37PM +0900, FUJITA Tomonori wrote:
> > On Thu, 4 Sep 2008 09:44:41 +0200
> > Andi Kleen <andi@firstfloor.org> wrote:
> >
> > > On Thu, Sep 04, 2008 at 01:11:47PM +0900, FUJITA Tomonori wrote:
> > > > On Thu, 04 Sep 2008 00:09:51 +0200
> > > > Andi Kleen <andi@firstfloor.org> wrote:
> > > >
> > > > > Joerg Roedel <joerg.roedel@amd.com> writes:
> > > > >
> > > > > > 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.
> > > > >
> > > > > The high level dma_alloc_coherent() does that anyways.
> > > >
> > > > The high level dma_alloc_coherent means the tricks in
> > > > arch/x86/pci-dma.c? If so, all the tricks has gone in tip/master.
> > >
> > > Seems wrong -- that is something that is needed by multiple
> > > IOMMUs. Pretty much all which work with real memory instead
> > > of virtual mappings.
> >
> > Not all the IOMMUs need the old tricks used in arch/x86/pci-dma.c.
>
> That is what I meant with "with real memory"
>
> But actually even for real IOMMus it can make sense to maintain
> some memory for bypass.

Even if it's tree, only each IOMMU knows what's the best. That's the
point of these changes to remove the tricks in arch/x86/pci-dma.c and
let IOMMUs do what they want.


> Also there's usually the problem that not all busses are translated,
> e.g. Calgary used to do that so for e.g. dev == NULL allocations you had
> to use these fallback algorithms anyways.

dev == NULL isn't a minor thing. It's just using the fallback
device. Playing with gfp flag is the major trick. Some (new) IOMMUs
don't need it.

Handling dev == NULL in a common place is fine by me. It's a minor
issue.


> Clearly copying the fallback logic into lots of low level IOMMUs instead
> of having it in one place is a big step backwards.


\
 
 \ /
  Last update: 2008-09-04 10:23    [W:0.053 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site