Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696909 > unrolled thread

Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags

Started byJoerg Roedel <joro@8bytes.org>
First post2017-07-26 11:20 +0200
Last post2017-07-26 11:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in  incoming GFP flags Joerg Roedel <joro@8bytes.org> - 2017-07-26 11:20 +0200
    Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in  incoming GFP flags Tomasz Figa <tfiga@chromium.org> - 2017-07-26 11:30 +0200

#1696909 — Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags

FromJoerg Roedel <joro@8bytes.org>
Date2017-07-26 11:20 +0200
SubjectRe: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags
Message-ID<u7qE1-6RT-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1696916

FromTomasz Figa <tfiga@chromium.org>
Date2017-07-26 11:30 +0200
Message-ID<u7qNI-6Vf-9@gated-at.bofh.it>
In reply to#1696909
Hi Joerg,

On Wed, Jul 26, 2017 at 6:15 PM, Joerg Roedel <joro@8bytes.org> wrote:
> 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.

It's a platform specific knowledge and I'd say the generic helper is
not where it should be decided. Please see my reply to Robin for v1
[1].

[1] https://patchwork.kernel.org/patch/9810921/

Best regards.
Tomasz

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web