Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-25 Thread Nicolin Chen
On Mon, Mar 25, 2019 at 12:14:37PM +, Catalin Marinas wrote: > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > index fcdb23e8d2fc..8955ba6f52fc 100644 > --- a/kernel/dma/direct.c > +++ b/kernel/dma/direct.c > @@ -111,8 +111,7 @@ struct page *__dma_direct_alloc_pages(struct device

Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-25 Thread Catalin Marinas
On Fri, Mar 22, 2019 at 01:09:26PM -0700, Nicolin Chen wrote: > On Fri, Mar 22, 2019 at 10:57:13AM +, Catalin Marinas wrote: > > > > Do you have any numbers to back this up? You don't seem to address > > > > dma_direct_alloc() either but, as I said above, it's not trivial since > > > > some

Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-22 Thread Nicolin Chen
Hi Catalin, On Fri, Mar 22, 2019 at 10:57:13AM +, Catalin Marinas wrote: > > > Do you have any numbers to back this up? You don't seem to address > > > dma_direct_alloc() either but, as I said above, it's not trivial since > > > some platforms expect certain physical range for DMA

Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-22 Thread Catalin Marinas
Hi Nicolin, On Thu, Mar 21, 2019 at 04:32:49PM -0700, Nicolin Chen wrote: > On Tue, Mar 19, 2019 at 02:43:01PM +, Catalin Marinas wrote: > > On Tue, Mar 05, 2019 at 10:32:02AM -0800, Nicolin Chen wrote: > > > The addresses within a single page are always contiguous, so it's > > > not so

Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-21 Thread Nicolin Chen
Hi Catalin, Thank you for the review. And I realized that the free() path is missing too. On Tue, Mar 19, 2019 at 02:43:01PM +, Catalin Marinas wrote: > On Tue, Mar 05, 2019 at 10:32:02AM -0800, Nicolin Chen wrote: > > The addresses within a single page are always contiguous, so it's > > not

Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-19 Thread Catalin Marinas
On Tue, Mar 05, 2019 at 10:32:02AM -0800, Nicolin Chen wrote: > The addresses within a single page are always contiguous, so it's > not so necessary to always allocate one single page from CMA area. > Since the CMA area has a limited predefined size of space, it may > run out of space in heavy use

[PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations

2019-03-05 Thread Nicolin Chen
The addresses within a single page are always contiguous, so it's not so necessary to always allocate one single page from CMA area. Since the CMA area has a limited predefined size of space, it may run out of space in heavy use cases, where there might be quite a lot CMA pages being allocated for