Messages in this thread | | | From | Rasmus Villemoes <> | Subject | Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full | Date | Thu, 19 Nov 2015 10:01:17 +0100 |
| |
On Thu, Nov 19 2015, Jia He <hejianet@gmail.com> 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
| |