Re: [PATCH v2] bitmap: speedup in bitmap_find_free_region when order is 0

2013-04-09 Thread Andrew Morton
On Tue, 9 Apr 2013 15:34:44 +0900 "Chanho Min" wrote: > >It seems excessively complicated to me. Why not change > >bitmap_find_free_region() to skip the leading all-ones words and when > >it finds a not-all-ones word, adjust `pos' then fall into the existing > >bit-at-a-time search? > > Do we n

Re: [PATCH v2] bitmap: speedup in bitmap_find_free_region when order is 0

2013-04-08 Thread Andrew Morton
On Mon, 08 Apr 2013 20:18:20 -0700 Joe Perches wrote: > On Mon, 2013-04-08 at 20:10 -0700, Andrew Morton wrote: > > > --- a/lib/bitmap.c > [] > > > + for (i = 0 ; i < nlongs_reg ; i++) { > > > > No space before the semicolon, please. checkpatch should warn about > > this but it seems to be brok

Re: [PATCH v2] bitmap: speedup in bitmap_find_free_region when order is 0

2013-04-08 Thread Joe Perches
On Mon, 2013-04-08 at 20:10 -0700, Andrew Morton wrote: > > --- a/lib/bitmap.c [] > > + for (i = 0 ; i < nlongs_reg ; i++) { > > No space before the semicolon, please. checkpatch should warn about > this but it seems to be broken. There's no specific CodingStyle violation here Adding --strict

Re: [PATCH v2] bitmap: speedup in bitmap_find_free_region when order is 0

2013-04-08 Thread Andrew Morton
On Tue, 9 Apr 2013 11:44:46 +0900 Chanho Min wrote: > If bitmap_find_free_region() is called with order=0, We can reduce > for-loops to find 1 free bit. First, It scans bitmap array by the > increment of long type, then find 1 free bit within 1 long type value. > > In 32 bits system and 1024 bi

[PATCH v2] bitmap: speedup in bitmap_find_free_region when order is 0

2013-04-08 Thread Chanho Min
If bitmap_find_free_region() is called with order=0, We can reduce for-loops to find 1 free bit. First, It scans bitmap array by the increment of long type, then find 1 free bit within 1 long type value. In 32 bits system and 1024 bits size, in the worst case, We need 1024 for-loops to find 1 free