RE: [Intel-wired-lan] [PATCH v2 4/4] drm/xe: switch xe_pagefault_queue_init() to using bitmap_weighted_or()

Loktionov, Aleksandr
2026-03-02T07:14:32Z

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Yury Norov via Intel-wired-lan
> Sent: Monday, March 2, 2026 2:12 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Thomas Hellström
> <thomas.hellstrom@linux.intel.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; Andrew Morton <akpm@linux-foundation.org>;
> David Airlie <airlied@gmail.com>; Eric Dumazet <edumazet@google.com>;
> Jakub Kicinski <kuba@kernel.org>; Brost, Matthew
> <matthew.brost@intel.com>; Paolo Abeni <pabeni@redhat.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; Vivi, Rodrigo
> <rodrigo.vivi@intel.com>; Simona Vetter <simona@ffwll.ch>; Yury Norov
> <yury.norov@gmail.com>; Rasmus Villemoes <linux@rasmusvillemoes.dk>;
> dri-devel@lists.freedesktop.org; intel-xe@lists.freedesktop.org;
> linux-kernel@vger.kernel.org; netdev@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org
> Cc: Yury Norov <ynorov@nvidia.com>; Simon Horman <horms@kernel.org>;
> David Laight <david.laight.linux@gmail.com>
> Subject: [Intel-wired-lan] [PATCH v2 4/4] 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

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>