[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190725124524.GB20286@infradead.org>
Date: Thu, 25 Jul 2019 05:45:24 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Benjamin Gaignard <benjamin.gaignard@...aro.org>
Cc: Christoph Hellwig <hch@...radead.org>,
John Stultz <john.stultz@...aro.org>,
lkml <linux-kernel@...r.kernel.org>,
Laura Abbott <labbott@...hat.com>,
Sumit Semwal <sumit.semwal@...aro.org>,
Liam Mark <lmark@...eaurora.org>,
Pratik Patel <pratikp@...eaurora.org>,
Brian Starkey <Brian.Starkey@....com>,
Vincent Donnefort <Vincent.Donnefort@....com>,
Sudipto Paul <Sudipto.Paul@....com>,
"Andrew F . Davis" <afd@...com>,
Xu YiPing <xuyiping@...ilicon.com>,
"Chenfeng (puck)" <puck.chen@...ilicon.com>,
butao <butao@...ilicon.com>,
"Xiaqing (A)" <saberlily.xia@...ilicon.com>,
Yudongbin <yudongbin@...ilicon.com>,
Chenbo Feng <fengc@...gle.com>,
Alistair Strachan <astrachan@...gle.com>,
dri-devel <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps
On Wed, Jul 24, 2019 at 10:08:54AM +0200, Benjamin Gaignard wrote:
> CMA has made possible to get large regions of memories and to give some
> priority on device allocating pages on it. I don't think that possible
> with system
> heap so I suggest to keep CMA heap if we want to be able to port a maximum
> of applications on dma-buf-heap.
Yes, CMA is a way to better allocate contigous regions, but it isn't
the only way to do that.
So at least for the system default CMA area it really should be a helper
for the system heap, especially given that CMA is an optional feature
and we can do high order contigous allocations using alloc_pages as
well.
Something like:
if (!require_contigous && order > 0) {
for (i = 0; i < nr_pages; i++)
page[i] = alloc_page();
goto done;
} else if (order > 0)
page = cma_alloc();
if (page)
goto done;
}
page = alloc_pages(order);
Powered by blists - more mailing lists