Re: [PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-07 Thread Jan Kara
On Tue 05-12-23 21:22:59, Yury Norov wrote: > On Mon, Dec 04, 2023 at 07:51:01PM +0100, Jan Kara wrote: > > > This series is a result of discussion [1]. All find_bit() functions imply > > > exclusive access to the bitmaps. However, KCSAN reports quite a number > > > of warnings related to find_bit(

Re: [PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-05 Thread Yury Norov
On Mon, Dec 04, 2023 at 07:51:01PM +0100, Jan Kara wrote: > Hello Yury! > > On Sun 03-12-23 11:23:47, Yury Norov wrote: > > Add helpers around test_and_{set,clear}_bit() that allow to search for > > clear or set bits and flip them atomically. > > > > The target patterns may look like this: > > >

Re: [PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-04 Thread Jan Kara
Hello Yury! On Sun 03-12-23 11:23:47, Yury Norov wrote: > Add helpers around test_and_{set,clear}_bit() that allow to search for > clear or set bits and flip them atomically. > > The target patterns may look like this: > > for (idx = 0; idx < nbits; idx++) > if (test_and_clea

Re: [PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-04 Thread Andy Shevchenko
On Sun, Dec 03, 2023 at 11:23:47AM -0800, Yury Norov wrote: > Add helpers around test_and_{set,clear}_bit() that allow to search for > clear or set bits and flip them atomically. > > The target patterns may look like this: > > for (idx = 0; idx < nbits; idx++) > if (test_and_c

[PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-03 Thread Yury Norov
Add helpers around test_and_{set,clear}_bit() that allow to search for clear or set bits and flip them atomically. The target patterns may look like this: for (idx = 0; idx < nbits; idx++) if (test_and_clear_bit(idx, bitmap)) do_something(idx); Or