[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK=WgbYG2tpMJ2SikZhm=R9j5kQ6Hm8CGg=q1bko3idzF53Q3Q@mail.gmail.com>
Date: Tue, 27 Sep 2011 16:28:37 +0300
From: Ohad Ben-Cohen <ohad@...ery.com>
To: "Roedel, Joerg" <Joerg.Roedel@....com>
Cc: "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
Hiroshi DOYU <Hiroshi.DOYU@...ia.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
David Woodhouse <dwmw2@...radead.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
David Brown <davidb@...eaurora.org>,
Arnd Bergmann <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Stepan Moskovchenko <stepanm@...eaurora.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH v3 1/6] iommu/core: split mapping to page sizes as
supported by the hardware
On Tue, Sep 27, 2011 at 4:12 PM, Roedel, Joerg <Joerg.Roedel@....com> wrote:
> You pass a pointer to an unsigned long for the page-size bitmap. This
> allows to use an array of unsigned long. But a single unsigned long is
> sufficient
This is fine; I can change that if you like it better (though without
doing the change below this is probably moot).
> and you can use functions like ffs() and fls() together with
> shifting. These functions often translate to a single intruction in the
> binary. The find_next_bit function has much more overhead because it
> needs to handle the array-of-ulong case.
So you're suggesting to re-implement find_next_bit() using ffs()/fls()
and shifting ?
What's the point ?
Sure, if we'll have a proven performance issue while using
find_next_bit() we can think of doing this, but at this stage, this
sounds to me like a premature optimization which isn't too elegant.
At this point I strongly prefer readable, maintainable and easier to
debug code over optimization which isn't proven to be necessary.
Thanks,
Ohad.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists