common: DMA-mapping: add DMA_ATTR_ALLOC_EXACT_SIZE attribute
Vandana Salve [Fri, 22 Nov 2013 09:26:32 +0000 (14:26 +0530)]
Add DMA_ATTR_ALLOC_EXACT_SIZE attribute to DMA-mapping subsystem

By default dma_alloc/free_coherent allocates/release memory
in order of 2^pages. By specifying this attribute, allocation/release
can be done for exact size of memory thereby reducing internal memory
fragmentation

bug 1380639

Change-Id: I49eb6a0caeb85aa84ff75fab6a4cf3c6a6d96abb
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-on: http://git-master/r/334416
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

include/linux/dma-attrs.h

index 75a6c18..81fb999 100644 (file)
@@ -22,6 +22,7 @@ enum dma_attr {
        DMA_ATTR_READ_ONLY,
        DMA_ATTR_WRITE_ONLY,
        DMA_ATTR_SKIP_IOVA_GAP,
+       DMA_ATTR_ALLOC_EXACT_SIZE,
        DMA_ATTR_MAX,
 };