[RESEND PATCH v3 0/5] pSeries FORM2 affinity support

Daniel Henrique Barboza posted 5 patches 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210825143943.529733-1-danielhb413@gmail.com
Maintainers: David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
There is a newer version of this series
hw/ppc/spapr.c              |  60 ++++------
hw/ppc/spapr_hcall.c        |   4 +
hw/ppc/spapr_numa.c         | 224 +++++++++++++++++++++++++++++++++---
include/hw/ppc/spapr.h      |   1 +
include/hw/ppc/spapr_numa.h |   3 +-
include/hw/ppc/spapr_ovec.h |   1 +
6 files changed, 236 insertions(+), 57 deletions(-)
[RESEND PATCH v3 0/5] pSeries FORM2 affinity support
Posted by Daniel Henrique Barboza 2 years, 7 months ago
Hi,

This is a repost of RFCv3 [1] rebased using current David's ppc-for-6.2.

The reason of this repost is that the kernel side changes got accepted
in the maintainer's tree [2], meaning that this series is now an implementation
of the future FORM2 kernel support in the pseries kernel.

In a POWER9 host with Annesh's patches from [2] and a QEMU with this
series, and a guest with the following NUMA distances:

(...)
-object memory-backend-ram,id=mem0,size=4G -numa node,memdev=mem0,cpus=0-1,nodeid=0 \
-object memory-backend-ram,id=mem1,size=4G -numa node,memdev=mem1,cpus=2-3,nodeid=1 \
-object memory-backend-ram,id=mem2,size=4G -numa node,memdev=mem2,cpus=4-5,nodeid=2 \
-object memory-backend-ram,id=mem3,size=2G -numa node,memdev=mem3,cpus=6-7,nodeid=3 \
-numa node,nodeid=4 \
-numa dist,src=0,dst=1,val=22 -numa dist,src=0,dst=2,val=22 \
-numa dist,src=0,dst=3,val=22 -numa dist,src=0,dst=4,val=22 \
-numa dist,src=1,dst=0,val=44 -numa dist,src=1,dst=2,val=44 \
-numa dist,src=1,dst=3,val=44 -numa dist,src=1,dst=4,val=44 \
-numa dist,src=2,dst=0,val=66 -numa dist,src=2,dst=1,val=66 \
-numa dist,src=2,dst=3,val=66 -numa dist,src=2,dst=4,val=66 \
-numa dist,src=3,dst=0,val=88 -numa dist,src=3,dst=1,val=88 \
-numa dist,src=3,dst=2,val=88 -numa dist,src=3,dst=4,val=88


This is the output of 'numactl -H' in the guest:

# numactl -H                                                                                       
available: 4 nodes (0-3)                                                                                             
node 0 cpus: 0 1                                        
node 0 size: 3987 MB                                                                   
node 0 free: 3362 MB                       
node 1 cpus: 2 3                                 
node 1 size: 4090 MB                                    
node 1 free: 4071 MB                                 
node 2 cpus: 4 5                                      
node 2 size: 4090 MB                      
node 2 free: 4075 MB                      
node 3 cpus: 6 7                       
node 3 size: 2027 MB                                                                                                 
node 3 free: 2010 MB                                                                                                 
node distances:                                                                                                      
node   0   1   2   3                                                                                                 
  0:  10  22  22  22
  1:  44  10  44  44
  2:  66  66  10  66
  3:  88  88  88  10


We're now able to set asynchronous distances between nodes while also
not being constrained to any fixed values (10, 20, 40, 80 ...) like we
currently are when using FORM1.


[1] https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg03622.html
[2] https://lore.kernel.org/linuxppc-dev/20210812132223.225214-1-aneesh.kumar@linux.ibm.com/


Daniel Henrique Barboza (5):
  spapr_numa.c: split FORM1 code into helpers
  spapr: move NUMA data init to post-CAS
  spapr_numa.c: base FORM2 NUMA affinity support
  spapr: simplify spapr_numa_associativity_init params
  spapr: move memory/cpu less check to spapr_numa_FORM1_affinity_init()

 hw/ppc/spapr.c              |  60 ++++------
 hw/ppc/spapr_hcall.c        |   4 +
 hw/ppc/spapr_numa.c         | 224 +++++++++++++++++++++++++++++++++---
 include/hw/ppc/spapr.h      |   1 +
 include/hw/ppc/spapr_numa.h |   3 +-
 include/hw/ppc/spapr_ovec.h |   1 +
 6 files changed, 236 insertions(+), 57 deletions(-)

-- 
2.31.1