Re: [PATCH v2 00/13] ip_tunnel: convert __be16 tunnel flags to bitmaps

2023-10-17 Thread Yury Norov
On Mon, Oct 16, 2023 at 06:52:34PM +0200, Alexander Lobakin wrote: > Based on top of "Implement MTE tag compression for swapped pages"[0] > from Alexander Potapenko as it uses its bitmap_{read,write}() functions > to not introduce another pair of similar ones. > > Derived from the PFCP support

Re: [PATCH 09/14] bitmap: extend bitmap_{get,set}_value8() to bitmap_{get,set}_bits()

2023-10-17 Thread Yury Norov
On Wed, Oct 11, 2023 at 11:33:25AM +0200, Alexander Lobakin wrote: > From: Yury Norov > Date: Mon, 9 Oct 2023 09:31:15 -0700 > > > + Alexander Potapenko > > > > On Mon, Oct 09, 2023 at 05:10:21PM +0200, Alexander Lobakin wrote: > >> Sometimes ther

Re: [PATCH v2 09/13] bitmap: make bitmap_{get,set}_value8() use bitmap_{read,write}()

2023-10-17 Thread Yury Norov
ompile time allows to generate just as good code with the generic bitmap_write/read(). Acked-by: Yury Norov > Suggested-by: Yury Norov > Signed-off-by: Alexander Lobakin > --- > include/linux/bitmap.h | 38 +- > 1 file changed, 5 insertions(+)

Re: [dm-devel] [PATCH 05/14] s390/cio: rename bitmap_size() -> idset_bitmap_size()

2023-10-10 Thread Yury Norov
On Mon, Oct 09, 2023 at 05:10:17PM +0200, Alexander Lobakin wrote: > bitmap_size() is a pretty generic name and one may want to use it for > a generic bitmap API function. At the same time, its logic is not > "generic", i.e. it's not just `nbits -> size of bitmap in bytes` > converter as it would

Re: [dm-devel] [PATCH 06/14] fs/ntfs3: rename bitmap_size() -> ntfs3_bitmap_size()

2023-10-10 Thread Yury Norov
On Mon, Oct 09, 2023 at 05:10:18PM +0200, Alexander Lobakin wrote: > bitmap_size() is a pretty generic name and one may want to use it for > a generic bitmap API function. At the same time, its logic is > NTFS-specific, as it aligns to the sizeof(u64), not the sizeof(long) > (although it uses

Re: [dm-devel] [PATCH 09/14] bitmap: extend bitmap_{get, set}_value8() to bitmap_{get, set}_bits()

2023-10-10 Thread Yury Norov
+ Alexander Potapenko On Mon, Oct 09, 2023 at 05:10:21PM +0200, Alexander Lobakin wrote: > Sometimes there's need to get a 8/16/...-bit piece of a bitmap at a > particular offset. Currently, there are only bitmap_{get,set}_value8() > to do that for 8 bits and that's it. And also a series from

Re: [dm-devel] [PATCH 03/14] bitops: let the compiler optimize __assign_bit()

2023-10-10 Thread Yury Norov
On Mon, Oct 09, 2023 at 05:10:15PM +0200, Alexander Lobakin wrote: > Since commit b03fc1173c0c ("bitops: let optimize out non-atomic bitops > on compile-time constants"), the compilers are able to expand inline > bitmap operations to compile-time initializers when possible. > However, during the

Re: [dm-devel] [PATCH 08/14] bitmap: introduce generic optimized bitmap_size()

2023-10-10 Thread Yury Norov
annoying. Acked-by: Yury Norov > Add one, bitmap_size(), but with one detail. > BITS_TO_LONGS() uses DIV_ROUND_UP(). The latter works well when both > divident and divisor are compile-time constants or when the divisor > is not a pow-of-2. When it is however, the compilers sometim

Re: [dm-devel] [PATCH 2/4] fs/ntfs3: Rename bitmap_size() as ntfs3_bitmap_size()

2022-07-07 Thread Yury Norov
ne size_t ntfs3_bitmap_size(size_t bits) > { > return ALIGN((bits + 7) >> 3, 8); > } Here everything looks OK for me. NTFS3 has their own good reasons to reserve 64-bit words for their bitmaps, and they need their own functions for this. And the prefix looks OK because

Re: [dm-devel] [PATCH 1/4] s390/cio: Rename bitmap_size() as idset_bitmap_size()

2022-07-07 Thread Yury Norov
On Sat, Jul 02, 2022 at 08:29:09PM +0200, Christophe JAILLET wrote: > In order to introduce a bitmap_size() function in the bitmap API, we have > to rename functions with a similar name. > > Add a "idset_" prefix and change bitmap_size() into idset_bitmap_size(). > > No functional change. > >

Re: [dm-devel] [PATCH 0/4] Introduce bitmap_size()

2022-07-07 Thread Yury Norov
On Sat, Jul 02, 2022 at 08:28:53PM +0200, Christophe JAILLET wrote: > This serie introduces bitmap_size() which returns the size, in bytes, of a > bitmap. Such a function is useful to simplify some drivers that use vmalloc() > or > other functions to allocate some butmaps. This generally looks

Re: [dm-devel] [PATCH 3/4] bitmap: Introduce bitmap_size()

2022-07-07 Thread Yury Norov
On Sun, Jul 03, 2022 at 06:20:53PM +0300, Andy Shevchenko wrote: > On Sun, Jul 03, 2022 at 08:50:19AM +0200, Christophe JAILLET wrote: > > Le 02/07/2022 à 23:09, Yury Norov a écrit : > > > On Sat, Jul 02, 2022 at 08:29:36PM +0200, Christophe JAILLET wrote: > > ... > &

Re: [dm-devel] [PATCH 3/4] bitmap: Introduce bitmap_size()

2022-07-07 Thread Yury Norov
On Sat, Jul 02, 2022 at 08:29:36PM +0200, Christophe JAILLET wrote: > The new bitmap_size() function returns the size, in bytes, of a bitmap. > > Remove the already existing bitmap_size() functions and macro in some > files. > These files already use the bitmap API and will use the new function >

Re: [dm-devel] [PATCH v3 0/5] bitmap: Introduce alloc/free helpers

2018-06-20 Thread Yury Norov
On Mon, Jun 18, 2018 at 04:09:58PM +0300, Andy Shevchenko wrote: > External Email > > A lot of code is using allocation of bitmaps using BITS_PER_LONG() macro and > sizeof(unsigned long) operator. The readability suffers because of this. > > The series introduces three helpers, i.e.

Re: [dm-devel] [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc()

2018-06-20 Thread Yury Norov
On Tue, Jun 19, 2018 at 11:33:16AM -0700, Dmitry Torokhov wrote: > External Email > > On Sat, Jun 16, 2018 at 12:42:31AM +0300, Yury Norov wrote: > > Hi Andy, > > > > On Fri, Jun 15, 2018 at 04:20:17PM +0300, Andy Shevchenko wrote: > > > Switch to bit

Re: [dm-devel] [PATCH v2 4/5] Input: gpio-keys - Switch to bitmap_zalloc()

2018-06-18 Thread Yury Norov
On Fri, Jun 15, 2018 at 04:20:16PM +0300, Andy Shevchenko wrote: > External Email > > Switch to bitmap_zalloc() to show clearly what we are allocating. > Besides that it returns pointer of bitmap type instead of opaque void *. Nit. There's no special type for bitmaps, bitmap_zalloc() returns

Re: [dm-devel] [PATCH v2 3/5] bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free()

2018-06-18 Thread Yury Norov
Hi Andy, On Fri, Jun 15, 2018 at 04:20:15PM +0300, Andy Shevchenko wrote: > A lot of code become ugly because of open coding allocations for bitmaps. > > Introduce three helpers to allow users be more clear of intention > and keep their code neat. I like the idea. But in following patches you

Re: [dm-devel] [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc()

2018-06-18 Thread Yury Norov
Hi Andy, On Fri, Jun 15, 2018 at 04:20:17PM +0300, Andy Shevchenko wrote: > Switch to bitmap_zalloc() to show clearly what we are allocating. > Besides that it returns pointer of bitmap type instead of opaque void *. > > Acked-by: Dmitry Torokhov > Signed-off-by: Andy Shevchenko > --- >