public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <ynorov@nvidia.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Yury Norov <yury.norov@gmail.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Andrew Morton <akpm@linux-foundation.org>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Matthew Brost <matthew.brost@intel.com>,
	David Laight <david.laight.linux@gmail.com>
Subject: Re: [PATCH RESEND 0/3] ice: use better bitmap API
Date: Wed, 25 Feb 2026 10:41:58 -0500	[thread overview]
Message-ID: <aZ8YRsdcRDcEUHmO@yury> (raw)
In-Reply-To: <7e4e207b-e839-4cfd-941b-5bec7a9ebff4@intel.com>

On Wed, Feb 25, 2026 at 01:02:35PM +0100, Przemek Kitszel wrote:
> On 2/25/26 01:00, Yury Norov wrote:
> > Use better bitmap API where appropriate.
> > 
> > Original series:
> > 
> > https://lore.kernel.org/all/20251223162303.434659-1-yury.norov@gmail.com/
> > 
> > RESEND: rebase on top of v7.0-rc1
> > 
> > Yury Norov (3):
> >    bitmap: introduce bitmap_weighted_xor()
> >    ice: use bitmap_weighted_xor() in ice_find_free_recp_res_idx()
> 
> Thank you for working on better API.
> Do you want this to go through intel, then netdev, tree?
> Likely that would slow any future user, if you have already one in mind.
>
> >    ice: use bitmap_empty() in ice_vf_has_no_qs_ena
> 
> For unrelated reasons I have one series that will possibly conflict
> with your patch. Would prefer to not wait/block each other, so will
> be best if we (Tony) just take this one (in case you will proceed
> with the first two patches via your tree)

Another trivial user (recently added) for bitmap_weighted_xx() is
xe_pagefault_queue_init() in drivers/gpu/drm/xe/xe_pagefault.c, but
it's again the Intel's driver, so it will go with your tree anyways.
 
I'm not aware of others, so I believe Tony's tree is the best route.

> >   drivers/net/ethernet/intel/ice/ice_switch.c |  4 +---
> >   drivers/net/ethernet/intel/ice/ice_vf_lib.c |  4 ++--
> >   include/linux/bitmap.h                      | 14 ++++++++++++++
> >   lib/bitmap.c                                |  7 +++++++
> >   4 files changed, 24 insertions(+), 5 deletions(-)

 + Matthew Brost

Attaching a patch for xe_pagefault_queue_init(). Feel free to append it
to this series, or let me know if it's better to send it separately.

Thanks,
Yury

From 21804f4ae1674aa166e3566fa898996806ebd3e3 Mon Sep 17 00:00:00 2001
From: Yury Norov <ynorov@nvidia.com>
Date: Wed, 25 Feb 2026 10:02:22 -0500
Subject: [PATCH] drm/xe: switch xe_pagefault_queue_init() to using
 bitmap_weighted_or()

The function calls bitmap_or() immediately followed by bitmap_weight().
Switch to using the dedicated bitmap_weighted_or() and save one bitmap
traverse.

Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 drivers/gpu/drm/xe/xe_pagefault.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_pagefault.c b/drivers/gpu/drm/xe/xe_pagefault.c
index 6bee53d6ffc3..c4ce3cfe2164 100644
--- a/drivers/gpu/drm/xe/xe_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_pagefault.c
@@ -285,10 +285,9 @@ static int xe_pagefault_queue_init(struct xe_device *xe,
 		xe_dss_mask_t all_dss;
 		int num_dss, num_eus;
 
-		bitmap_or(all_dss, gt->fuse_topo.g_dss_mask,
+		num_dss = bitmap_weighted_or(all_dss, gt->fuse_topo.g_dss_mask,
 			  gt->fuse_topo.c_dss_mask, XE_MAX_DSS_FUSE_BITS);
 
-		num_dss = bitmap_weight(all_dss, XE_MAX_DSS_FUSE_BITS);
 		num_eus = bitmap_weight(gt->fuse_topo.eu_mask_per_dss,
 					XE_MAX_EU_FUSE_BITS) * num_dss;
 
-- 
2.43.0


      reply	other threads:[~2026-02-25 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  0:00 [PATCH RESEND 0/3] ice: use better bitmap API Yury Norov
2026-02-25  0:00 ` [PATCH RESEND 1/3] bitmap: introduce bitmap_weighted_xor() Yury Norov
2026-03-01 15:19   ` [RESEND,1/3] " Simon Horman
2026-02-25  0:00 ` [PATCH RESEND 2/3] ice: use bitmap_weighted_xor() in ice_find_free_recp_res_idx() Yury Norov
2026-02-25  0:00 ` [PATCH RESEND 3/3] ice: use bitmap_empty() in ice_vf_has_no_qs_ena Yury Norov
2026-02-25 12:02 ` [PATCH RESEND 0/3] ice: use better bitmap API Przemek Kitszel
2026-02-25 15:41   ` Yury Norov [this message]

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=aZ8YRsdcRDcEUHmO@yury \
    --to=ynorov@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=david.laight.linux@gmail.com \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=matthew.brost@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=yury.norov@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox