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


Groups > linux.kernel > #1375557

Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages

Path csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod
From Yong Wu <yong.wu@mediatek.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages
Date Mon, 11 Apr 2016 09:50:03 +0200
Message-ID <rmELF-2aR-41@gated-at.bofh.it> (permalink)
References <rhz0d-36r-1@gated-at.bofh.it> <ri5js-TR-11@gated-at.bofh.it> <rkCEj-7qs-9@gated-at.bofh.it> <rlEkG-4cu-9@gated-at.bofh.it> <rlHVg-6PT-17@gated-at.bofh.it> <rlIxY-7r6-35@gated-at.bofh.it> <rlIxY-7r6-33@gated-at.bofh.it>
X-Original-To Will Deacon <will.deacon@arm.com>, Doug Anderson <dianders@chromium.org>
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.2.3-0ubuntu6
Content-Transfer-Encoding 7bit
MIME-Version 1.0
X-Mtk N
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 44
Organization linux.* mail to news gateway
X-Original-Cc Joerg Roedel <joro@8bytes.org>, Catalin Marinas <catalin.marinas@arm.com>, Matthias Brugger <matthias.bgg@gmail.com>, Robin Murphy <robin.murphy@arm.com>, Daniel Kurtz <djkurtz@google.com>, Tomasz Figa <tfiga@google.com>, Arnd Bergmann <arnd@arndb.de>, Lucas Stach <l.stach@pengutronix.de>, Marek Szyprowski <m.szyprowski@samsung.com>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, <srv_heupstream@mediatek.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux-foundation.org>
X-Original-Date Mon, 11 Apr 2016 15:40:10 +0800
X-Original-Message-ID <1460360410.18251.10.camel@mhfsdcap03>
X-Original-References <1459146732-15620-1-git-send-email-yong.wu@mediatek.com> <20160329170238.GK6745@arm.com> <CAD=FV=XdZwg8usj3bjM6W=A0Yk1AFqKFRadpiS-LGLwxVNxp7A@mail.gmail.com> <20160408130733.GD23750@arm.com> <CAD=FV=VbekVUHW3=d0icSgUO1M-1cccwCAZ+s=YSzOtEveCQag@mail.gmail.com> <20160408173002.GJ23750@arm.com> <CAD=FV=XbL6gbdmX62Q3QJQ6R-rC7cCd44RLPgK3kvhAC49BJjA@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1375557

Show key headers only | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages Doug Anderson <dianders@chromium.org> - 2016-04-05 19:10 +0200
  Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in  __iommu_dma_alloc_pages Will Deacon <will.deacon@arm.com> - 2016-04-08 15:10 +0200
    Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages Doug Anderson <dianders@chromium.org> - 2016-04-08 19:00 +0200
      Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages Doug Anderson <dianders@chromium.org> - 2016-04-08 19:40 +0200
        Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in  __iommu_dma_alloc_pages Yong Wu <yong.wu@mediatek.com> - 2016-04-11 09:50 +0200
      Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in  __iommu_dma_alloc_pages Will Deacon <will.deacon@arm.com> - 2016-04-08 19:40 +0200

csiph-web