Re: [PATCH v3 2/2] dma-pool: Only allocate from CMA when in same memory zone

From: Christoph Hellwig
Date: Fri Aug 07 2020 - 01:21:23 EST


On Thu, Aug 06, 2020 at 08:47:55PM +0200, Nicolas Saenz Julienne wrote:
> There is no guarantee to CMA's placement, so allocating a zone specific
> atomic pool from CMA might return memory from a completely different
> memory zone. To get around this double check CMA's placement before
> allocating from it.

As the builtbot pointed out, memblock_start_of_DRAM can't be used from
non-__init code. But lookig at it I think throwing that in
is bogus anyway, as cma_get_base returns a proper physical address
already.