Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-05-02 Thread Christoph Hellwig
On Tue, Apr 30, 2019 at 04:24:21PM +0100, Catalin Marinas wrote: > My reading of the arm32 __dma_alloc() is that if the conditions are > right for the CMA allocator (allows blocking) and there is a default CMA > area or a per-device one, the call ends up in cma_alloc() without any > fallback if suc

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-30 Thread Catalin Marinas
(catching up on email) On Wed, Apr 24, 2019 at 09:26:52PM +0200, Christoph Hellwig wrote: > On Wed, Apr 24, 2019 at 11:33:11AM -0700, Nicolin Chen wrote: > > I feel it's similar to my previous set, which did most of these > > internally except the renaming part. But Catalin had a concern > > that

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-26 Thread Christoph Hellwig
On Fri, Apr 26, 2019 at 01:21:12PM -0700, Nicolin Chen wrote: > What do you think of dma_free_contiguous() instead? I feel "free" > is a bit more commonly used (in dma-mapping.h) and it's shorter. Yeah, that sounds good. ___ iommu mailing list iommu@list

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-26 Thread Nicolin Chen
On Wed, Apr 24, 2019 at 05:06:38PM +0200, Christoph Hellwig wrote: > > + if (!dma_release_from_contiguous(dev, page, count)) > > + __free_pages(page, get_order(size)); > > Same for dma_release_from_contiguous - drop the _from, pass the > actual size, and

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-24 Thread Nicolin Chen
On Wed, Apr 24, 2019 at 09:26:52PM +0200, Christoph Hellwig wrote: > On Wed, Apr 24, 2019 at 11:33:11AM -0700, Nicolin Chen wrote: > > I feel it's similar to my previous set, which did most of these > > internally except the renaming part. But Catalin had a concern > > that some platforms might hav

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-24 Thread Christoph Hellwig
On Wed, Apr 24, 2019 at 11:33:11AM -0700, Nicolin Chen wrote: > I feel it's similar to my previous set, which did most of these > internally except the renaming part. But Catalin had a concern > that some platforms might have limits on CMA range [1]. Will it > be still okay to do the fallback inter

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-24 Thread Nicolin Chen
Hi Christoph, On Wed, Apr 24, 2019 at 05:06:38PM +0200, Christoph Hellwig wrote: > On Tue, Mar 26, 2019 at 04:01:27PM -0700, Nicolin Chen wrote: > > page = dma_alloc_from_contiguous(dev, count, order, gfp & __GFP_NOWARN); > > + if (!page) > > + page = alloc_pages(gfp, order); > >

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-24 Thread Christoph Hellwig
On Wed, Apr 24, 2019 at 05:06:38PM +0200, Christoph Hellwig wrote: > I'd also use the oppurtunity to forbid a NULL dev argument and > opencode those uses. Actually, looking at your last patch again the NULL argument might still fit in ok, so maybe we should keep it. _

Re: [PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-04-24 Thread Christoph Hellwig
On Tue, Mar 26, 2019 at 04:01:27PM -0700, Nicolin Chen wrote: > page = dma_alloc_from_contiguous(dev, count, order, gfp & __GFP_NOWARN); > + if (!page) > + page = alloc_pages(gfp, order); We have this fallback in most callers already. And with me adding it to the dma-iommu c

[PATCH v2 RFC/RFT 1/5] ARM: dma-mapping: Add fallback normal page allocations

2019-03-26 Thread Nicolin Chen
The CMA allocation will skip allocations of single pages to save CMA resource. This requires its callers to rebound those page allocations from normal area. So this patch adds fallback routines. Signed-off-by: Nicolin Chen --- arch/arm/mm/dma-mapping.c | 13 ++--- 1 file changed, 10 inse