[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdL9du5QRvi9Jz7kjPDrNwqCtH8-1qXsVbKD_BuKM01uA@mail.gmail.com>
Date: Wed, 28 Jul 2021 12:18:46 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Andrea Merello <andrea.merello@...il.com>
Cc: Yury Norov <yury.norov@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Andrea Merello <andrea.merello@....it>
Subject: Re: [PATCH v1 1/1] bitmap.h: add const modifier to
bitmap_next_[set/clear]_region() argument
On Wed, Jul 28, 2021 at 9:39 AM Andrea Merello <andrea.merello@...il.com> wrote:
> Il giorno mar 27 lug 2021 alle ore 17:26 Yury Norov
> <yury.norov@...il.com> ha scritto:
> > On Tue, Jul 27, 2021 at 02:48:42PM +0300, Andy Shevchenko wrote:
...
> > I try to remove those two because in practice they bring more mess
> > than good. All real use-cases for bitmap_next_{set,clear}_region
> > relate to iterating the whole bitmap, ie nobody just wants to find a
> > next region. Untill recently there was only a single user of the API,
> > so I easily reworked the code to use find_first_bit/find_next bit and
> > by chance return faster.
>
> Ah, that's interesting to know: I'm working on a new driver that used
> find_next_zero_bit() and find_next_bit() [0]; Andy told me that my
> algorithm could be rewritten exploiting some bitmap_* helpers, so I
> rewrote my code using bitmap_for_each_set_region(), which in turn uses
> bitmap_next_set_region().
>
> Should I revert to my previous implementation that uses
> find_next_zero_bit() and find_next_bit() ?
According to the
https://github.com/norov/linux/commit/a2d6e02d19450a49a55f08c151d1f704723bec1a
they are transformed to for_each_bitrange(), etc.
...
> Looks like also bitmap_for_each_set_region() went away indeed ?
See above.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists