CMA region and highmem

Daniel Drake drake at endlessm.com
Thu Jan 22 12:55:51 PST 2015


On Thu, Aug 21, 2014 at 3:32 AM, Marek Szyprowski
<m.szyprowski at samsung.com> wrote:
> You are right, but frankly drivers doing large DMA allocations should take
> advantage of DMA_ATTR_NO_KERNEL_MAPPING DMA attribute, because all they
> usually do is just mapping those buffers to userspace. For a bit complex
> example, see drivers/gpu/drm/exynos/exynos_drm_buf.c or
> drivers/gpu/drm/msm/msm_drv.c.

Thanks again for the insight here. Revisiting this topic now:

Looking at DMA_ATTR_NO_KERNEL_MAPPING in latest linus git, this only
seems to be implemented for IOMMU setups.
On other setups this flag seems to be ignored, so on such setups, your
change that tends to place the CMA region in high memory now puts
pressure on the vmalloc area even when the driver asked for
NO_KERNEL_MAPPING.

Is there a good reason why the non-IOMMU codepath doesn't obey
DMA_ATTR_NO_KERNEL_MAPPING? We ran a quick experiment here
implementing this (i.e. just bailing out of __alloc_from_contiguous
before mapping the memory into kernel space) and it seems to work.

Daniel



More information about the linux-arm-kernel mailing list