lkml.org 
[lkml]   [2017]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags
On Tue, Jul 04, 2017 at 10:55:55PM +0900, Tomasz Figa wrote:
> Current implementation of __iommu_dma_alloc_pages() keeps adding
> __GFP_HIGHMEM to GFP flags regardless of whether other zone flags are
> already included in the incoming flags. If __GFP_DMA or __GFP_DMA32 is
> set at the same time as __GFP_HIGHMEM, the allocation fails due to
> invalid zone flag combination.
>
> Fix this by checking for __GFP_DMA and __GFP_DMA32 in incoming GFP flags
> and adding __GFP_HIGHMEM only if they are not present.
>
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>

Isn't it better to mask out __GFP_DMA and __GFP_DMA32 in the allocation
flags and only take them into account for iova allocation?

When the IOMMU re-maps the DMA to this memory it doesn't matter where it
is in system memory.



Joerg

\
 
 \ /
  Last update: 2017-07-26 11:16    [W:0.074 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site