Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272949

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

From Rasmus Villemoes <linux@rasmusvillemoes.dk>
Newsgroups linux.kernel
Subject Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full
Date 2015-11-19 10:10 +0100
Message-ID <qwto7-7iI-7@gated-at.bofh.it> (permalink)
References <qwrcB-5Lq-3@gated-at.bofh.it>
Organization D03

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] Improve bitmap_empty and bitmap_full Jia He <hejianet@gmail.com> - 2015-11-19 07:50 +0100
  [PATCH v2 2/3] lib: Introduce 2 bit ops api: all_is_bit_{one,zero} Jia He <hejianet@gmail.com> - 2015-11-19 07:50 +0100
    Re: [PATCH v2 2/3] lib: Introduce 2 bit ops api:  all_is_bit_{one,zero} xinhui <xinhui@linux.vnet.ibm.com> - 2015-11-19 09:50 +0100
      Re: [PATCH v2 2/3] lib: Introduce 2 bit ops api:  all_is_bit_{one,zero} hejianet <hejianet@gmail.com> - 2015-11-19 10:00 +0100
    Re: [PATCH v2 2/3] lib: Introduce 2 bit ops api: all_is_bit_{one,zero} yalin wang <yalin.wang2010@gmail.com> - 2015-11-19 10:00 +0100
  Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-11-19 10:10 +0100

csiph-web