All of lore.kernel.org
 help / color / mirror / Atom feed
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations
Date: Fri, 21 Jun 2013 11:33:40 +0200	[thread overview]
Message-ID: <51C41DF4.4090802@samsung.com> (raw)
In-Reply-To: <51C2FDE0.4060206@cogentembedded.com>

Hello,

On 6/20/2013 3:04 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 20-06-2013 16:31, Richard Zhao wrote:
>
>> __iommu_alloc_buffer wants to split pages after allocation in order to
>> reduce the memory footprint. This does not work well with __GFP_COMP
>> pages, so drop this flag before allocation
>
>> One failure example is snd_malloc_dev_pages call dma_alloc_coherent with
>> __GFP_COMP.
>
>> Signed-off-by: Richard Zhao <rizhao@nvidia.com>
>> ---
>>   arch/arm/mm/dma-mapping.c |    9 +++++++++
>>   1 file changed, 9 insertions(+)
>
>> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
>> index ef3e0f3..f7efffd 100644
>> --- a/arch/arm/mm/dma-mapping.c
>> +++ b/arch/arm/mm/dma-mapping.c
>> @@ -1314,6 +1314,15 @@ static void *arm_iommu_alloc_attrs(struct 
>> device *dev, size_t size,
>>       if (gfp & GFP_ATOMIC)
>>           return __iommu_alloc_atomic(dev, size, handle);
>>
>> +    /*
>> +     * Following is a work-around (a.k.a. hack) to prevent pages
>> +     * with __GFP_COMP being passed to split_page() which cannot
>> +     * handle them.  The real problem is that this flag probably
>> +     * should be 0 on ARM as it is not supported on this
>> +     * platform; see CONFIG_HUGETLBFS.
>> +     */
>> +    gfp &= ~(__GFP_COMP);
>
>    Hm, what exactly is the sense you meant in using ()?

I think that those parentheses come from the first patch, which disabled 
__GFP_COMP
in dma-mapping allocations: 3611553ef98 ("[AVR32] Drop GFP_COMP for DMA 
memory
allocations"). I would like to take this patch to the dma-mapping tree 
together with
other changes related to iommu integration code.

Best regards
-- 
Marek Szyprowski
Samsung R&D Institute Poland

  parent reply	other threads:[~2013-06-21  9:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 12:31 [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations Richard Zhao
2013-06-20 13:04 ` Sergei Shtylyov
2013-06-20 13:40   ` Richard Zhao
     [not found]     ` <CANg6MZg3A7-oXfdUSarQ8n0PRsS0_BLjqfQ914KUoSzDDtShFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-20 14:35       ` Hiroshi Doyu
2013-06-20 14:35         ` Hiroshi Doyu
     [not found]         ` <20130620.173511.831032817734076793.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-21  4:52           ` Richard Zhao
2013-06-21  4:52             ` Richard Zhao
2013-06-21  9:33   ` Marek Szyprowski [this message]
2013-06-21 11:04     ` Richard Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C41DF4.4090802@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.