linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: yong.wu@mediatek.com (Yong Wu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages
Date: Mon, 11 Apr 2016 15:40:10 +0800	[thread overview]
Message-ID: <1460360410.18251.10.camel@mhfsdcap03> (raw)
In-Reply-To: <CAD=FV=XbL6gbdmX62Q3QJQ6R-rC7cCd44RLPgK3kvhAC49BJjA@mail.gmail.com>

On Fri, 2016-04-08 at 10:34 -0700, Doug Anderson wrote:
> Hi,
> 
> On Fri, Apr 8, 2016 at 10:30 AM, Will Deacon <will.deacon@arm.com> wrote:
> >> > Am I barking up the wrong tree?
> >>
> >> I don't think min_order can be negative.  Certainly we could enter the
> >> loop with order == 0 and min_order == 0, though.
> >
> > ... and in that case, PageCompound will be false, and we'll call split_page
> > which won't do anything, so we break out.
> >
> >>
> >> Some examples:
> >>
> >> order = 0, min_order = 0
> >> -> Want alloc_pages _without_ __GFP_NORETRY.  OK
> >> -> If alloc_pages fails, return NULL.  OK
> >> -> If alloc pages succeeds, don't need splitting since single page.  OK
> >
> > [...]
> >
> >> I think those are all right.  Did I mess up?  You could certainly
> >> structure the loop in a different way but you need to make sure you
> >> handle all of those cases.  If you have an alternate structure that
> >> handles all those, let's consider it.
> >
> > Right, I don't think the code is broken, I just think the !order check is
> > confusing and not needed.
> 
> Ah ha!  Got it.  I didn't dig into split_page() to see that it was a
> no-op when "order == 0".  I just know that the old code didn't call
> split_page() with order == 0 so I assumed that was wise to keep.  If
> we don't need to keep that then agreed that the "if" test can simply
> be removed.  :)
> 
> -Doug

Hi Will, Doug,

Thanks very much for review this patch, and Thanks Robin's work,
Currently this one is obsoleted since it's included in [1].

[1]:http://lists.linuxfoundation.org/pipermail/iommu/2016-April/016402.html

      reply	other threads:[~2016-04-11  7:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28  6:32 [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages Yong Wu
2016-03-28  6:32 ` [PATCH v2 2/2] arm64/dma-mapping: Add DMA_ATTR_ALLOC_SINGLE_PAGES support Yong Wu
2016-03-29 17:02 ` [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages Will Deacon
2016-04-05 17:03   ` Doug Anderson
2016-04-08 13:07     ` Will Deacon
2016-04-08 16:50       ` Doug Anderson
2016-04-08 17:30         ` Will Deacon
2016-04-08 17:34           ` Doug Anderson
2016-04-11  7:40             ` Yong Wu [this message]

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=1460360410.18251.10.camel@mhfsdcap03 \
    --to=yong.wu@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).