[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=XbL6gbdmX62Q3QJQ6R-rC7cCd44RLPgK3kvhAC49BJjA@mail.gmail.com>
Date: Fri, 8 Apr 2016 10:34:10 -0700
From: Doug Anderson <dianders@...omium.org>
To: Will Deacon <will.deacon@....com>
Cc: Yong Wu <yong.wu@...iatek.com>, Joerg Roedel <joro@...tes.org>,
Catalin Marinas <catalin.marinas@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Robin Murphy <robin.murphy@....com>,
Daniel Kurtz <djkurtz@...gle.com>,
Tomasz Figa <tfiga@...gle.com>, Arnd Bergmann <arnd@...db.de>,
Lucas Stach <l.stach@...gutronix.de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>, srv_heupstream@...iatek.com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
iommu@...ts.linux-foundation.org
Subject: Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages
Hi,
On Fri, Apr 8, 2016 at 10:30 AM, Will Deacon <will.deacon@....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
Powered by blists - more mailing lists