mbox series

[ovs-dev,v5,0/2] Support for non-contiguous numa nodes and core ids.

Message ID 20210525192724.20021-1-dwilder@us.ibm.com
Headers show
Series Support for non-contiguous numa nodes and core ids. | expand

Message

David Wilder May 25, 2021, 7:27 p.m. UTC
Ovs-numa currently makes the assumption that numa node ids and cpu core ids
will be numbered contiguously. Current Power systems don't always follow this
model. Furthermore, cpus on Power may be on/off lined based the setting of
Simultaneous multithreading (SMT). The result can be gaps in the numbering of
the cores. For example, a 2 socket system with 20 Core(s) per socket configured
with 4 thread per core (smt=4) has the following topology:

NUMA node0 CPU(s):   0-79
NUMA node8 CPU(s):   80-159

When set to smt=2 the following topology is created.

NUMA node0 CPU(s): 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29,32,33,36,37,40,
                   41,44,45,48,49,52,53,56,57,60,61,64,65,68,69,72,73,76,77
NUMA node8 CPU(s): 80,81,84,85,88,89,92,93,96,97,100,101,104,105,108,109,112,
                   113,116,117,120,121,124,125,128,129,132,133,136,137,140,
                   141,144,145,148,149,152,153,156,157

The first patch in this series allows ovs-numa to work with non-contiguous
node and cpu ids. I updated pmd and dpif-netdev multi-node tests to simulate
a numa topology with non-contiguous node ids.

The second patch in the series updates lib/dpdk:construct_dpdk_socket_mem()
to correctly build the EAL options: --socket-mem and --socket-limit on systems
with non-contiguous node ids.

v2 changes:
-0-day Robot suggested changes.
v3 changes:
-re-wrote cpu_detected() to address memory leak.
V4 changes:
-Rebased patches for:
 https://patchwork.ozlabs.org/project/openvswitch/list/?series=157389.
-Extended the automated tests to test both contiguous and non-contiguous
 configurations.
-changed the phrase "non-consecutive" to "non-contiguous" (since 0, 8 is
 consecutive but not contiguous).
V5 changes 
-Removed unused variable max_numa_id in discover_numa_and_core_dummy().
-Cleanup snprintf formatting in cpu_detected().
-Simplified test coverage of non-contiguous and contiguous nodes.
-Fixed bug in construct_dpdk_socket_mem().

A travis build with these two patches can be found here:
https://travis-ci.org/github/djlwilder/ovs/builds/772249286

David Wilder (2):
  ovs-numa: Support non-contiguous numa nodes and offline CPU cores
  ovs-numa: Dpdk options with non-contiguous nodes

 lib/dpdk.c           | 33 ++++++++++++++++++++++++---------
 lib/ovs-numa.c       | 51 ++++++++++++++++++++++++++++++++++-----------------
 lib/ovs-numa.h       |  2 ++
 tests/dpif-netdev.at | 12 ++++++------
 tests/pmd.at         | 23 ++++++++++++++++++++---
 5 files changed, 86 insertions(+), 35 deletions(-)