Skip to content

RFC numa: add '-numa cpu' option

Igor Mammedov qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13numa: access CPU's node id via property in hmp_info_numa()hw/arm/virt.c hw/i386/pc.c hw/ppc/spapr.c +12 more+28 -282 replies
2/13pc: cleanup: move smbios_set_cpuid() into pc_build_smbios()hw/i386/pc.c+9 -81 reply
3/13pc: don't return cpu pointer from pc_new_cpu() as it's not needed anymorehw/i386/pc.c+8 -161 reply
4/13make possible_cpu_arch_ids() return const pointerhw/acpi/cpu.c hw/acpi/cpu_hotplug.c hw/i386/acpi-build.c +5 more+13 -230 replies
5/13pc: move pcms->possible_cpus init out of pc_cpus_init()hw/i386/pc.c+20 -92 replies
6/13pc: calculate topology only once when possible_cpus is initialisedhw/i386/pc.c include/hw/boards.h+14 -120 replies
7/13pc: pass apic_id to pc_find_cpu_slot() directly so lookup could be done without CPU objecthw/i386/pc.c+9 -70 replies
8/13pc: add writeonly 'cpu' property to PCMachinehw/i386/pc.c+56 -07 replies
9/13numa: introduce '-numa cpu' cpu optioninclude/sysemu/numa.h numa.c qapi-schema.json +1 more+31 -64 replies
10/13numa: replace cpu_index_to_socket_id() with cpu_index_to_instance_props()hw/i386/pc.c hw/ppc/spapr.c include/hw/boards.h +1 more+29 -160 replies
11/13numa: use new machine.cpu property with -numa cpus=... CLInuma.c+48 -152 replies
12/13pc: drop usage of legacy numa_get_node_for_cpu()hw/acpi/cpu.c hw/i386/acpi-build.c hw/i386/pc.c+15 -280 replies
13/13pc: cpu: make sure that cpu.node-id matches -numa mappinghw/i386/pc.c target/i386/cpu.c+11 -20 replies

Reviews trailers per patch

2 of 13 patches have a Reviewed-by or Acked-by.

PatchEduardo Habkost
1/13
2/13R-b
3/13R-b
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 00/13] numa: add '-numa cpu' option

Series introduces a new CLI option to allow mapping cpus to numa nodes using public properties [socket|core|thread]-ids instead of internal cpu-index and moving cpu<->node mapping from global bitmaps to PCMachineState struct.

It focuses on PC in RFC version to see if approach is suitable in general, later we can move generic parts to common code or do a bigger non RFC version of this series that would take care of all concerned targets (arm-virt/spapr/pc).
Thing which I've kept PC specific but could be generalized is:
* moving array possible_cpus to generic MachineState where
we already have possible_cpu_arch_ids(). I plan to reuse it in virt-arm for CPU hotplug/-device cpu support and as this series shows it also could be used for numa mapping.
Perhaps it could be used in simmilar manner for core based SPAPR but I haven't looked it yet. So any opions on if we should move it there.

So far it only provides CLI interface to do mapping, there is no QMP one as I haven't found a suitable place/way to update/set mapping after machine_done for QEMU started with -S (stoppod mode) so that mgmt could query hopluggable-cpus first, then map them to numa nodes in runtime before actually allowing guest to run.
Any suggestions on how to make it work are welcome.

PS:
skipped travis-ci build as currently it seems to be broken.

Igor Mammedov (13):
numa: access CPU's node id via property in hmp_info_numa()
pc: cleanup: move smbios_set_cpuid() into pc_build_smbios()
pc: don't return cpu pointer from pc_new_cpu() as it's not needed
anymore
make possible_cpu_arch_ids() return const pointer
pc: move pcms->possible_cpus init out of pc_cpus_init()
pc: calculate topology only once when possible_cpus is initialised
pc: pass apic_id to pc_find_cpu_slot() directly so lookup could be
done without CPU object
pc: add writeonly 'cpu' property to PCMachine
numa: introduce '-numa cpu' cpu option
numa: replace cpu_index_to_socket_id() with
cpu_index_to_instance_props()
numa: use new machine.cpu property with -numa cpus=... CLI
pc: drop usage of legacy numa_get_node_for_cpu()
pc: cpu: make sure that cpu.node-id matches -numa mapping

 include/hw/acpi/acpi_dev_interface.h |   2 +-
 include/hw/boards.h                  |  14 ++-
 include/hw/i386/pc.h                 |   2 +-
 include/qom/cpu.h                    |   2 -
 include/sysemu/numa.h                |   3 +-
 target/arm/cpu.h                     |   2 +
 target/i386/cpu.h                    |   1 +
 target/ppc/cpu.h                     |   2 +
 hw/acpi/cpu.c                        |  13 +--
 hw/acpi/cpu_hotplug.c                |   4 +-
 hw/arm/virt.c                        |  12 +-
 hw/i386/acpi-build.c                 |  25 ++---
 hw/i386/pc.c                         | 210 +++++++++++++++++++++++------------
 hw/ppc/spapr.c                       |  15 ++-
 hw/ppc/spapr_cpu_core.c              |   2 +-
 monitor.c                            |   7 +-
 numa.c                               |  89 +++++++++++----
 qapi-schema.json                     |   3 +-
 stubs/pc_madt_cpu_entry.c            |   2 +-
 target/arm/cpu.c                     |   1 +
 target/i386/cpu.c                    |   1 +
 target/ppc/translate_init.c          |   1 +
 vl.c                                 |   4 +-
 23 files changed, 269 insertions(+), 148 deletions(-)
Signature · 1 line
2.7.4