some question about __dma_alloc in arch/arm/mm/dma-mapping.c

Catalin Marinas catalin.marinas at arm.com
Mon Jul 6 03:11:28 PDT 2015


On Sat, Jul 04, 2015 at 11:08:52PM +0800, vichy wrote:
> in __dma_alloc of arch/arm/mm/dma-mapping.c, if the size of allocation
> is PAGE_SIZE, we will use __alloc_remap_buffer instead of
> __alloc_from_contiguous like below excerpted from __dma_alloc.
> 
> Is any special reason for PAGE_SIZE allocation NOT getting from continuous pool?
> Appreciate your kind help in advance,
> 
>          ..............
>          if (is_coherent || nommu())
>                  addr = __alloc_simple_buffer(dev, size, gfp, &page);
>          else if (!(gfp & __GFP_WAIT))
>                  addr = __alloc_from_pool(size, &page);
>          else if (size == PAGE_SIZE || !CMA_DEFAULT_REGION)
>                  addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
>          else
>                  addr = __alloc_from_contiguous(dev, size, prot, &page, caller);

You should probably ask whoever gave you this kernel as I can't find the
code above in mainline.

-- 
Catalin



More information about the linux-arm-kernel mailing list