Re: remove bitmap_shift_*() bitmap length limits

From: William Lee Irwin III
Date: Sun Apr 04 2004 - 02:06:24 EST


On Sat, Apr 03, 2004 at 10:57:12PM -0800, Paul Jackson wrote:
> There was one bug in my untested code for simple bitmap shifts,
> the left shift needs to scan downwards, not upwards, so as to
> avoid clobbering the input if shifting inplace.
> The total text size of my user level test program is actually
> made smaller with this per-bit simple implementation, as compared
> to the implementation currently in the kernel, by 80 bytes.
> Bill Irwin's more sophisticated version grows the text size,
> over the current implementation, by 304 bytes. This is on
> Pentium pc, gcc version 3.3.2, compiled -O2.
> Given the very rare usage this bitmap shift routines receive,
> I cast my vote for small and simple.
> The more sophisticated logic of Bill's implementation is
> impressive, but unjustified in this situation, in my view.
> My fixed shift functions are:

I don't see this as a hard problem or why you call the implementation I
brewed up impressive. I don't personally have a preference as to what
implementation is used so long as it's not got fixed-size arrays in it,
though I am somewhat puzzled as to why you bothered.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/