* Re: [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations
[not found] ` <CANg6MZg3A7-oXfdUSarQ8n0PRsS0_BLjqfQ914KUoSzDDtShFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-06-20 14:35 ` Hiroshi Doyu
[not found] ` <20130620.173511.831032817734076793.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hiroshi Doyu @ 2013-06-20 14:35 UTC (permalink / raw)
To: linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
Richard Zhao, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Stephen Warren,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Richard Zhao <linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote @ Thu, 20 Jun 2013 15:40:50 +0200:
> >> + /*
> >> + * 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 ()?
>
> It's copy/paste from elsewhere in this file. At least it's consistent? :)
I almost sent the exact same one, actually it was under internal reivew;)
This patch is similar but is the iommu version of:
commit ea2e7057c0234cfb8b09467d8f137760d371fc72
Author: Sumit Bhattacharya <sumitb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Date: Thu Nov 24 00:47:12 2011 +0100
ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations
dma_alloc_coherent 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.
This patch is ported from arch/avr32
(commit 3611553ef985ef7c5863c8a94641738addd04cff).
[swarren: s/HUGETLB_PAGE/HUGETLBFS/ in comment, minor comment cleanup]
Signed-off-by: Sumit Bhattacharya <sumitb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Tested-by: Varun Colbert <vcolbert-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ab58456..1aa664a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -332,6 +332,15 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
struct page *page;
void *addr;
+ /*
+ * 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);
+
*handle = ~0;
size = PAGE_ALIGN(size);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations
[not found] ` <20130620.173511.831032817734076793.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2013-06-21 4:52 ` Richard Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Richard Zhao @ 2013-06-21 4:52 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Stephen Warren,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Thu, Jun 20, 2013 at 10:35:11PM +0800, Hiroshi Doyu wrote:
> Richard Zhao <linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote @ Thu, 20 Jun 2013 15:40:50 +0200:
>
> > >> + /*
> > >> + * 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 ()?
> >
> > It's copy/paste from elsewhere in this file. At least it's consistent? :)
>
> I almost sent the exact same one, actually it was under internal reivew;)
Ah, sorry I didn't search internal mails but only arm mail list for related
fix, since I thought it's not specific to tegra. Why not give it a
Reviewed-by or Tested-by?
>
> This patch is similar but is the iommu version of:
Exactly.
Thanks
Richard
>
>
> commit ea2e7057c0234cfb8b09467d8f137760d371fc72
> Author: Sumit Bhattacharya <sumitb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Date: Thu Nov 24 00:47:12 2011 +0100
>
> ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations
>
> dma_alloc_coherent 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.
>
> This patch is ported from arch/avr32
> (commit 3611553ef985ef7c5863c8a94641738addd04cff).
>
> [swarren: s/HUGETLB_PAGE/HUGETLBFS/ in comment, minor comment cleanup]
>
> Signed-off-by: Sumit Bhattacharya <sumitb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Tested-by: Varun Colbert <vcolbert-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index ab58456..1aa664a 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -332,6 +332,15 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
> struct page *page;
> void *addr;
>
> + /*
> + * 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);
> +
> *handle = ~0;
> size = PAGE_ALIGN(size);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-21 4:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1371731460-15316-1-git-send-email-rizhao@nvidia.com>
[not found] ` <51C2FDE0.4060206@cogentembedded.com>
[not found] ` <CANg6MZg3A7-oXfdUSarQ8n0PRsS0_BLjqfQ914KUoSzDDtShFg@mail.gmail.com>
[not found] ` <CANg6MZg3A7-oXfdUSarQ8n0PRsS0_BLjqfQ914KUoSzDDtShFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-20 14:35 ` [PATCH] ARM: dma: Drop __GFP_COMP for iommu dma memory allocations Hiroshi Doyu
[not found] ` <20130620.173511.831032817734076793.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-21 4:52 ` Richard Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox