All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com,
	vneethv@linux.ibm.com, oberpar@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, agordeev@linux.ibm.com,
	borntraeger@linux.ibm.com, svens@linux.ibm.com,
	almaz.alexandrovich@paragon-software.com,
	andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
	linux-s390@vger.kernel.org, ntfs3@lists.linux.dev,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 0/4] Introduce bitmap_size()
Date: Sat, 2 Jul 2022 13:44:12 -0700	[thread overview]
Message-ID: <YsCuHLTsKGCO/jsL@yury-laptop> (raw)
In-Reply-To: <cover.1656785856.git.christophe.jaillet@wanadoo.fr>

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 like a step in a wrong direction. Bitmap is by
definition an array of bits. If someone has a reason to handle bitmap
on a per-byte basis, the guy is probably doing something wrong.

We already have quite comprehensive list of functions that help to
allocate, fill, clear, copy etc bitmap without considering it as an
array of bytes or words.

> ... some drivers that use vmalloc() ...

If a driver needs vmalloc() for a bitmap, we should introduce
bitmap_vmalloc(), not bitmap_size().

> It also hides some implementation details about how bitmaps are stored (array of
> longs)

Sorry, I don't understand that. How bitmap_size() helps to hide a fact that
bitmap is an array of unsigned longs? (Except that it makes an impression
that it's an array of bytes.)

> Before introducing this function in patch 3, patch 1 and 2 rename some functions
> with the same name but with different meaning.
> 
> Finaly, patch 4 makes use of the new function in bitmap.h.

You mentioned, you need bitmap_size() to use with vmalloc(), but in
patch 4, there's no such code. 
 
> Other follow-up patches to simplify some drivers will be proposed later if/when
> this serie is merged.

This series doesn't show an example of how you're going to use new
API, and therefore it's hard to judge, do we really need bitmap_size(),
or we just need more helpers around.

As I already said, bitmaps are evolving in 2nd direction, which is the
right approach, I think.

Thanks,
Yury

> Christophe JAILLET (4):
>   s390/cio: Rename bitmap_size() as idset_bitmap_size()
>   fs/ntfs3: Rename bitmap_size() as ntfs3_bitmap_size()
>   bitmap: Introduce bitmap_size()
>   bitmap: Use bitmap_size()
> 
>  drivers/md/dm-clone-metadata.c |  5 -----
>  drivers/s390/cio/idset.c       |  8 ++++----
>  fs/ntfs3/bitmap.c              |  4 ++--
>  fs/ntfs3/fsntfs.c              |  2 +-
>  fs/ntfs3/index.c               |  6 +++---
>  fs/ntfs3/ntfs_fs.h             |  2 +-
>  fs/ntfs3/super.c               |  2 +-
>  include/linux/bitmap.h         | 15 +++++++++------
>  lib/math/prime_numbers.c       |  2 --
>  9 files changed, 21 insertions(+), 25 deletions(-)
> 
> -- 
> 2.34.1

WARNING: multiple messages have this Message-ID (diff)
From: Yury Norov <yury.norov@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linux-s390@vger.kernel.org, kernel-janitors@vger.kernel.org,
	andriy.shevchenko@linux.intel.com, gor@linux.ibm.com,
	linux@rasmusvillemoes.dk, hca@linux.ibm.com,
	ntfs3@lists.linux.dev, snitzer@kernel.org, oberpar@linux.ibm.com,
	linux-kernel@vger.kernel.org,
	almaz.alexandrovich@paragon-software.com, dm-devel@redhat.com,
	svens@linux.ibm.com, vneethv@linux.ibm.com,
	agordeev@linux.ibm.com, borntraeger@linux.ibm.com,
	agk@redhat.com
Subject: Re: [dm-devel] [PATCH 0/4] Introduce bitmap_size()
Date: Sat, 2 Jul 2022 13:44:12 -0700	[thread overview]
Message-ID: <YsCuHLTsKGCO/jsL@yury-laptop> (raw)
In-Reply-To: <cover.1656785856.git.christophe.jaillet@wanadoo.fr>

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 like a step in a wrong direction. Bitmap is by
definition an array of bits. If someone has a reason to handle bitmap
on a per-byte basis, the guy is probably doing something wrong.

We already have quite comprehensive list of functions that help to
allocate, fill, clear, copy etc bitmap without considering it as an
array of bytes or words.

> ... some drivers that use vmalloc() ...

If a driver needs vmalloc() for a bitmap, we should introduce
bitmap_vmalloc(), not bitmap_size().

> It also hides some implementation details about how bitmaps are stored (array of
> longs)

Sorry, I don't understand that. How bitmap_size() helps to hide a fact that
bitmap is an array of unsigned longs? (Except that it makes an impression
that it's an array of bytes.)

> Before introducing this function in patch 3, patch 1 and 2 rename some functions
> with the same name but with different meaning.
> 
> Finaly, patch 4 makes use of the new function in bitmap.h.

You mentioned, you need bitmap_size() to use with vmalloc(), but in
patch 4, there's no such code. 
 
> Other follow-up patches to simplify some drivers will be proposed later if/when
> this serie is merged.

This series doesn't show an example of how you're going to use new
API, and therefore it's hard to judge, do we really need bitmap_size(),
or we just need more helpers around.

As I already said, bitmaps are evolving in 2nd direction, which is the
right approach, I think.

Thanks,
Yury

> Christophe JAILLET (4):
>   s390/cio: Rename bitmap_size() as idset_bitmap_size()
>   fs/ntfs3: Rename bitmap_size() as ntfs3_bitmap_size()
>   bitmap: Introduce bitmap_size()
>   bitmap: Use bitmap_size()
> 
>  drivers/md/dm-clone-metadata.c |  5 -----
>  drivers/s390/cio/idset.c       |  8 ++++----
>  fs/ntfs3/bitmap.c              |  4 ++--
>  fs/ntfs3/fsntfs.c              |  2 +-
>  fs/ntfs3/index.c               |  6 +++---
>  fs/ntfs3/ntfs_fs.h             |  2 +-
>  fs/ntfs3/super.c               |  2 +-
>  include/linux/bitmap.h         | 15 +++++++++------
>  lib/math/prime_numbers.c       |  2 --
>  9 files changed, 21 insertions(+), 25 deletions(-)
> 
> -- 
> 2.34.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2022-07-02 20:44 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 18:28 [PATCH 0/4] Introduce bitmap_size() Christophe JAILLET
2022-07-02 18:28 ` [dm-devel] " Christophe JAILLET
2022-07-02 18:29 ` [PATCH 1/4] s390/cio: Rename bitmap_size() as idset_bitmap_size() Christophe JAILLET
2022-07-02 18:29   ` [dm-devel] " Christophe JAILLET
2022-07-02 18:54   ` Andy Shevchenko
2022-07-02 18:54     ` [dm-devel] " Andy Shevchenko
2022-07-02 19:24     ` Christophe JAILLET
2022-07-02 19:24       ` [dm-devel] " Christophe JAILLET
2022-07-02 19:24       ` Christophe JAILLET
2022-07-02 19:32       ` Andy Shevchenko
2022-07-02 19:32         ` [dm-devel] " Andy Shevchenko
2022-07-02 19:42         ` Christophe JAILLET
2022-07-02 19:42           ` [dm-devel] " Christophe JAILLET
2022-07-02 19:42           ` Christophe JAILLET
2022-07-02 19:42           ` Christophe JAILLET
2022-07-02 20:46   ` Yury Norov
2022-07-02 20:46     ` [dm-devel] " Yury Norov
2022-07-04  4:28   ` Vineeth Vijayan
2022-07-04  4:28     ` [dm-devel] " Vineeth Vijayan
2022-07-02 18:29 ` [PATCH 2/4] fs/ntfs3: Rename bitmap_size() as ntfs3_bitmap_size() Christophe JAILLET
2022-07-02 18:29   ` [dm-devel] " Christophe JAILLET
2022-07-02 18:58   ` Andy Shevchenko
2022-07-02 18:58     ` [dm-devel] " Andy Shevchenko
2022-07-02 19:37     ` Christophe JAILLET
2022-07-02 19:37       ` [dm-devel] " Christophe JAILLET
2022-07-02 19:37       ` Christophe JAILLET
2022-07-02 20:57   ` Yury Norov
2022-07-02 20:57     ` [dm-devel] " Yury Norov
2022-07-02 18:29 ` [PATCH 3/4] bitmap: Introduce bitmap_size() Christophe JAILLET
2022-07-02 18:29   ` [dm-devel] " Christophe JAILLET
2022-07-02 18:59   ` Andy Shevchenko
2022-07-02 18:59     ` [dm-devel] " Andy Shevchenko
2022-07-02 21:09   ` Yury Norov
2022-07-02 21:09     ` [dm-devel] " Yury Norov
2022-07-03  6:50     ` Christophe JAILLET
2022-07-03  6:50       ` [dm-devel] " Christophe JAILLET
2022-07-03  6:50       ` Christophe JAILLET
2022-07-03 15:20       ` Andy Shevchenko
2022-07-03 15:20         ` [dm-devel] " Andy Shevchenko
2022-07-03 19:13         ` Yury Norov
2022-07-03 19:13           ` [dm-devel] " Yury Norov
2022-07-03 20:41           ` Christophe JAILLET
2022-07-03 20:41             ` [dm-devel] " Christophe JAILLET
2022-07-02 18:29 ` [PATCH 4/4] bitmap: Use bitmap_size() Christophe JAILLET
2022-07-02 18:29   ` [dm-devel] " Christophe JAILLET
2022-07-02 20:44 ` Yury Norov [this message]
2022-07-02 20:44   ` [dm-devel] [PATCH 0/4] Introduce bitmap_size() Yury Norov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsCuHLTsKGCO/jsL@yury-laptop \
    --to=yury.norov@gmail.com \
    --cc=agk@redhat.com \
    --cc=agordeev@linux.ibm.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dm-devel@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=ntfs3@lists.linux.dev \
    --cc=oberpar@linux.ibm.com \
    --cc=snitzer@kernel.org \
    --cc=svens@linux.ibm.com \
    --cc=vneethv@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.