mbox series

[net-next,V3,0/3] Introduce and use NUMA distance metrics

Message ID 20220719162339.23865-1-tariqt@nvidia.com (mailing list archive)
Headers show
Series Introduce and use NUMA distance metrics | expand

Message

Tariq Toukan July 19, 2022, 4:23 p.m. UTC
Hi,

Implement and expose CPU spread API based on the scheduler's
sched_numa_find_closest().  Use it in mlx5 and enic device drivers.  This
replaces the binary NUMA preference (local / remote) with an improved one
that minds the actual distances, so that remote NUMAs with short distance
are preferred over farther ones.

This has significant performance implications when using NUMA-aware
memory allocations, improving the throughput and CPU utilization.

Regards,
Tariq

v3:
- Introduce the logic as a common API instead of being mlx5 specific.
- Add implementation to enic device driver.
- Use non-atomic version of __cpumask_clear_cpu.

v2:
- Replace EXPORT_SYMBOL with EXPORT_SYMBOL_GPL, per Peter's comment.
- Separate the set_cpu operation into two functions, per Saeed's suggestion.
- Add Saeed's Acked-by signature.


Tariq Toukan (3):
  sched/topology: Add NUMA-based CPUs spread API
  net/mlx5e: Improve remote NUMA preferences used for the IRQ affinity
    hints
  enic: Use NUMA distances logic when setting affinity hints

 drivers/net/ethernet/cisco/enic/enic_main.c  | 10 +++-
 drivers/net/ethernet/mellanox/mlx5/core/eq.c |  5 +-
 include/linux/sched/topology.h               |  4 ++
 kernel/sched/topology.c                      | 49 ++++++++++++++++++++
 4 files changed, 64 insertions(+), 4 deletions(-)

Comments

Tariq Toukan July 24, 2022, 12:09 p.m. UTC | #1
On 7/19/2022 7:23 PM, Tariq Toukan wrote:
> Hi,
> 
> Implement and expose CPU spread API based on the scheduler's
> sched_numa_find_closest().  Use it in mlx5 and enic device drivers.  This
> replaces the binary NUMA preference (local / remote) with an improved one
> that minds the actual distances, so that remote NUMAs with short distance
> are preferred over farther ones.
> 
> This has significant performance implications when using NUMA-aware
> memory allocations, improving the throughput and CPU utilization.
> 
> Regards,
> Tariq
> 
> v3:
> - Introduce the logic as a common API instead of being mlx5 specific.
> - Add implementation to enic device driver.
> - Use non-atomic version of __cpumask_clear_cpu.
> 

Comments on V2 were addressed.
Please let me now of any other comments on this V3.
Jakub Kicinski July 25, 2022, 6:20 p.m. UTC | #2
On Sun, 24 Jul 2022 15:09:11 +0300 Tariq Toukan wrote:
> On 7/19/2022 7:23 PM, Tariq Toukan wrote:
> > Hi,
> > 
> > Implement and expose CPU spread API based on the scheduler's
> > sched_numa_find_closest().  Use it in mlx5 and enic device drivers.  This
> > replaces the binary NUMA preference (local / remote) with an improved one
> > that minds the actual distances, so that remote NUMAs with short distance
> > are preferred over farther ones.
> > 
> > This has significant performance implications when using NUMA-aware
> > memory allocations, improving the throughput and CPU utilization.
>
> Comments on V2 were addressed.
> Please let me now of any other comments on this V3.

Good enough from my POV, just waiting for PeterZ's re-ack since patch 1
has changed.