Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full

From: Rasmus Villemoes
Date: Thu Nov 19 2015 - 04:01:34 EST


On Thu, Nov 19 2015, Jia He <hejianet@xxxxxxxxx> wrote:

> find_fisrt_{zero_}bit are too heavy for bitmap_{full,empty}. We don't
> need to calculate and compare the position of bitmap. This set of patch
> instroduces lightweight api and replaces the heavy one.
>

Please check the history of the code you're modifying. git blame
include/linux/bitmap.h would immediately point you to 2afe27c718b
"lib/bitmap.c: bitmap_[empty,full]: remove code duplication". While it's
obviously true that find_first_bit does slightly more work than strictly
necessary to establish whether the bitmap is empty, it does the same
number of memory accesses, so I wouldn't consider it particularly
heavy-weight. Getting rid of .text as 2afe27c718b did is a good thing,
so you'd have to explain why we should reintroduce specialized functions
for this.

Your code is also buggy :-(

Rasmus
--
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/