[parisc-linux] [patch 2/2] backport of sba sg list management to ccio-dma
Grant Grundler
grundler at parisc-linux.org
Wed Oct 24 00:46:49 MDT 2007
On Tue, Oct 23, 2007 at 06:15:34PM +0200, Joel Soete wrote:
...
> This seems to be better fls then ffs like:
> int get_iovp_order_faster(unsigned long size)
> {
> return fls((size - 1) >> (IOVP_SHIFT));
> }
Yes, I didn't really think about fls() vs ffs().
But you figured it out. :)
I just wanted the asm() version that's 10x faster than looping through
and testing each bit.
> Even thought following test seems to be ok:
> unsigned int a;
> unsigned long ul;
>
> /* for proof of concept
> */
> for (ul=0; ul<536870914; ul++) {
> if ( get_iovp_order(ul) != get_iovp_order_faster(ul) ) {
> printf("get_iovp_order(%ld) = %ld (0x%x)\n\n", ul, a = get_iovp_order(ul), a);
> printf("get_iovp_order_faster(%ld) = %ld (0x%x)\n\n", ul, a =
> get_iovp_order_faster(ul), a);
> exit (1);
> }
> }
>
> But what would give the kernel generic (include/asm-generic/page.h: this is
> what get_iovp_order() is if IOVP_SHIFT==PAGE_SHIFT) get_order(0): 0?
> the answer is 20 for paric and ia32?
I don't know offhand.
I'm not sure we have to handle that case...or if we do, make sure it's handled correctly in get_iovp_order().
> > ...
> > +#ifdef CCIO_MAP_STATS
> > + ioc->usg_pages += sg_dma_len(sglist) >> IOVP_SHIFT;
> > + ioc->usingle_calls--; /* kluge since call is unmap_sg() */
> > +#endif
> >
> > I wouldn't add MAP_STATS here.
> > They aren't enabled in SBA becuase they impact performance too much.
> > I expect that will always be true and would seriously consider removing
> > MAP_STATS code from SBA as well. Timing the bitmap search is
> > probably the only critical bit of info that really matters.
> > And that's for developement/testing only.
> >
> mmm, I would so let stay here but with just additional comment to prevent to
> activate it outside this developement/testing context?
That's fine too. Just making a suggestion here since stats are alot less
useful when stats interfere with the actual performance measurements.
Reducing the stats only measuring the search time would make more sense
to me.
cheers,
grant
More information about the parisc-linux
mailing list