Re: [PATCH 2/3] x86, swiotlb: Try coherent allocations with __GFP_NOWARN

From: Baoquan He
Date: Sun Jan 25 2015 - 22:25:17 EST


On 01/23/15 at 06:03pm, Borislav Petkov wrote:
> On Tue, Jan 06, 2015 at 03:51:13PM +0100, Joerg Roedel wrote:
> > From: Joerg Roedel <jroedel@xxxxxxx>

> > diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
> > index 77dd0ad..79b2291 100644
> > --- a/arch/x86/kernel/pci-swiotlb.c
> > +++ b/arch/x86/kernel/pci-swiotlb.c
> > @@ -20,6 +20,14 @@ void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
> > {
> > void *vaddr;
> >
> > + /*
> > + * When booting a kdump kernel in high memory these allocations are very
> > + * likely to fail, as there are by default only 8MB of low memory to
> > + * allocate from. So disable the warnings from the allocator when this
> > + * happens. SWIOTLB also implements fall-backs for failed allocations.
> > + */
> > + flags |= __GFP_NOWARN;
>
> Ok, so this practically does all allocations __GFP_NOWARN now. Shouldn't
> you be doing this before swiotlb_alloc_coherent() and not before
> dma_generic_alloc_coherent()?

I think this patch mainly suppress warning from buddy allocation
failure because it tried buddy allocation several times before the final
try of bounce buffer allocation. Buddy allocation failure will call
dump_stack.


>
> > vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags,
> > attrs);
> > if (vaddr)
>
> --
> Regards/Gruss,
> Boris.
>
> ECO tip #101: Trim your mails when you reply.
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/