Re: [PATCH] dma-buf: heaps: Set VM_PFNMAP in mmap for system and cma heaps

From: Christoph Hellwig
Date: Sat Feb 27 2021 - 04:49:11 EST


On Fri, Feb 26, 2021 at 08:36:55AM +0100, Daniel Vetter wrote:
> Also given that both deal with struct page there's a ton of divergence
> between these two that doesn't make much sense. Maybe could even share
> the code fully, aside from how you allocate the struct pages.

I've been saying that since the code was first submitted. Once pages
are allocated from CMA they should be treated not different from normal
pages.

Please take a look at how the DMA contigous allocator manages to share
all code for handling CMA vs alloc_pages pages.