[PATCH 0/7] RDMA: hfi1: cpumasks usage fixes

Yury Norov posted 7 patches 6 months, 2 weeks ago
drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
include/linux/cpumask.h               | 12 ++++
2 files changed, 49 insertions(+), 59 deletions(-)
[PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Yury Norov 6 months, 2 weeks ago
The driver uses cpumasks API in a non-optimal way; partially because of
absence of proper functions. Fix this and nearby logic.

Yury Norov [NVIDIA] (7):
  cpumask: add cpumask_clear_cpus()
  RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
  RDMA: hfi1: simplify find_hw_thread_mask()
  RDMA: hfi1: simplify init_real_cpu_mask()
  RDMA: hfi1: use rounddown in find_hw_thread_mask()
  RDMA: hfi1: simplify hfi1_get_proc_affinity()
  RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c

 drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
 include/linux/cpumask.h               | 12 ++++
 2 files changed, 49 insertions(+), 59 deletions(-)

-- 
2.43.0
Re: [PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Leon Romanovsky 5 months, 3 weeks ago
On Wed, 04 Jun 2025 15:39:36 -0400, Yury Norov wrote:
> The driver uses cpumasks API in a non-optimal way; partially because of
> absence of proper functions. Fix this and nearby logic.
> 
> Yury Norov [NVIDIA] (7):
>   cpumask: add cpumask_clear_cpus()
>   RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
>   RDMA: hfi1: simplify find_hw_thread_mask()
>   RDMA: hfi1: simplify init_real_cpu_mask()
>   RDMA: hfi1: use rounddown in find_hw_thread_mask()
>   RDMA: hfi1: simplify hfi1_get_proc_affinity()
>   RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
> 
> [...]

Applied, thanks!

[1/7] cpumask: add cpumask_clear_cpus()
      https://git.kernel.org/rdma/rdma/c/c15d5e70db9627
[2/7] RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
      https://git.kernel.org/rdma/rdma/c/37b3cba54b404a
[3/7] RDMA: hfi1: simplify find_hw_thread_mask()
      https://git.kernel.org/rdma/rdma/c/f2c2afbba77c11
[4/7] RDMA: hfi1: simplify init_real_cpu_mask()
      https://git.kernel.org/rdma/rdma/c/9c965445a636b7
[5/7] RDMA: hfi1: use rounddown in find_hw_thread_mask()
      https://git.kernel.org/rdma/rdma/c/9370795029d41a
[6/7] RDMA: hfi1: simplify hfi1_get_proc_affinity()
      https://git.kernel.org/rdma/rdma/c/7c2c2f3a205b2b
[7/7] RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
      https://git.kernel.org/rdma/rdma/c/185e34e8f249cb

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>
Re: [PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Leon Romanovsky 6 months, 1 week ago
On Wed, Jun 04, 2025 at 03:39:36PM -0400, Yury Norov wrote:
> The driver uses cpumasks API in a non-optimal way; partially because of
> absence of proper functions. Fix this and nearby logic.
> 
> Yury Norov [NVIDIA] (7):
>   cpumask: add cpumask_clear_cpus()
>   RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
>   RDMA: hfi1: simplify find_hw_thread_mask()
>   RDMA: hfi1: simplify init_real_cpu_mask()
>   RDMA: hfi1: use rounddown in find_hw_thread_mask()
>   RDMA: hfi1: simplify hfi1_get_proc_affinity()
>   RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
> 
>  drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
>  include/linux/cpumask.h               | 12 ++++
>  2 files changed, 49 insertions(+), 59 deletions(-)

Dennis?

> 
> -- 
> 2.43.0
>
Re: [PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Yury Norov 6 months ago
On Thu, Jun 12, 2025 at 11:12:29AM +0300, Leon Romanovsky wrote:
> On Wed, Jun 04, 2025 at 03:39:36PM -0400, Yury Norov wrote:
> > The driver uses cpumasks API in a non-optimal way; partially because of
> > absence of proper functions. Fix this and nearby logic.
> > 
> > Yury Norov [NVIDIA] (7):
> >   cpumask: add cpumask_clear_cpus()
> >   RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
> >   RDMA: hfi1: simplify find_hw_thread_mask()
> >   RDMA: hfi1: simplify init_real_cpu_mask()
> >   RDMA: hfi1: use rounddown in find_hw_thread_mask()
> >   RDMA: hfi1: simplify hfi1_get_proc_affinity()
> >   RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
> > 
> >  drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
> >  include/linux/cpumask.h               | 12 ++++
> >  2 files changed, 49 insertions(+), 59 deletions(-)
> 
> Dennis?

So?.. Any feedback?
Re: [PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Dennis Dalessandro 5 months, 4 weeks ago
On 6/21/25 11:03 AM, Yury Norov wrote:
> On Thu, Jun 12, 2025 at 11:12:29AM +0300, Leon Romanovsky wrote:
>> On Wed, Jun 04, 2025 at 03:39:36PM -0400, Yury Norov wrote:
>>> The driver uses cpumasks API in a non-optimal way; partially because of
>>> absence of proper functions. Fix this and nearby logic.
>>>
>>> Yury Norov [NVIDIA] (7):
>>>   cpumask: add cpumask_clear_cpus()
>>>   RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
>>>   RDMA: hfi1: simplify find_hw_thread_mask()
>>>   RDMA: hfi1: simplify init_real_cpu_mask()
>>>   RDMA: hfi1: use rounddown in find_hw_thread_mask()
>>>   RDMA: hfi1: simplify hfi1_get_proc_affinity()
>>>   RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
>>>
>>>  drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
>>>  include/linux/cpumask.h               | 12 ++++
>>>  2 files changed, 49 insertions(+), 59 deletions(-)
>>
>> Dennis?
> 
> So?.. Any feedback?

I'm ambivalent about this patch series. It looks OK but I don't think it's
really fixing anything.
Re: [PATCH 0/7] RDMA: hfi1: cpumasks usage fixes
Posted by Leon Romanovsky 5 months, 3 weeks ago
On Mon, Jun 23, 2025 at 12:23:36PM -0400, Dennis Dalessandro wrote:
> On 6/21/25 11:03 AM, Yury Norov wrote:
> > On Thu, Jun 12, 2025 at 11:12:29AM +0300, Leon Romanovsky wrote:
> >> On Wed, Jun 04, 2025 at 03:39:36PM -0400, Yury Norov wrote:
> >>> The driver uses cpumasks API in a non-optimal way; partially because of
> >>> absence of proper functions. Fix this and nearby logic.
> >>>
> >>> Yury Norov [NVIDIA] (7):
> >>>   cpumask: add cpumask_clear_cpus()
> >>>   RDMA: hfi1: fix possible divide-by-zero in find_hw_thread_mask()
> >>>   RDMA: hfi1: simplify find_hw_thread_mask()
> >>>   RDMA: hfi1: simplify init_real_cpu_mask()
> >>>   RDMA: hfi1: use rounddown in find_hw_thread_mask()
> >>>   RDMA: hfi1: simplify hfi1_get_proc_affinity()
> >>>   RDMI: hfi1: drop cpumask_empty() call in hfi1/affinity.c
> >>>
> >>>  drivers/infiniband/hw/hfi1/affinity.c | 96 +++++++++++----------------
> >>>  include/linux/cpumask.h               | 12 ++++
> >>>  2 files changed, 49 insertions(+), 59 deletions(-)
> >>
> >> Dennis?
> > 
> > So?.. Any feedback?
> 
> I'm ambivalent about this patch series. It looks OK but I don't think it's
> really fixing anything.

Yeas, I applied because more code was deleted than added.