Refactoring pc_dimm_plug and NUMA node lookup API
cover Refactoring pc_dimm_plug and NUMA node lookup API
Hi,
This is the next version of the NUMA lookup API v0 that I posted earlier. In this version, I have added a patch to factor out generic code from pc_dimm_plug() so that the same can be used by other architectures. I combined NUMA lookup API and this patch together since they are related and touch common code.
This version is based on the feedback I received for my v0 post:
https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg01078.html
Bharata B Rao (4):
pc,pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate
routine
numa,pc-dimm: Store pc-dimm memory information in numa_info
numa: Store boot memory address range in node_info
numa: API to lookup NUMA node by address
hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 90 +++++++++--------------------------------------- hw/mem/pc-dimm.c | 84 ++++++++++++++++++++++++++++++++++++++++++++ include/hw/i386/pc.h | 4 +-- include/hw/mem/pc-dimm.h | 9 +++++ include/sysemu/numa.h | 11 ++++++ numa.c | 82 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 206 insertions(+), 76 deletions(-)
Signature · 1 line
2.1.0
RFC PATCH 1/4 pc, pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate routine
pc_dimm_plug() has code that will be needed for memory plug handlers in other archs too. Extract code from pc_dimm_plug() into a generic routine pc_dimm_memory_plug() that resides in pc-dimm.c. Also correspondingly refactor re-usable unplug code into pc_dimm_memory_unplug().
--- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 90 +++++++++--------------------------------------- hw/mem/pc-dimm.c | 80 ++++++++++++++++++++++++++++++++++++++++++ include/hw/i386/pc.h | 4 +-- include/hw/mem/pc-dimm.h | 9 +++++ 5 files changed, 109 insertions(+), 76 deletions(-)
hw/i386/acpi-build.c +1 -1
@@ -1512,7 +1512,7 @@ build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)*/ if (hotplugabble_address_space_size) { numamem =acpi_data_push (table_data,sizeof *numamem); -acpi_build_srat_memory (numamem, pcms->hotplug_memory_base, +acpi_build_srat_memory (numamem, pcms->hotplug_memory.base, hotplugabble_address_space_size,0 ,MEM_AFFINITY_HOTPLUGGABLE |MEM_AFFINITY_ENABLED );
hw/i386/pc.c +17 -73
162 lines not on this page · raw message
hw/mem/pc-dimm.c +80 -0
92 lines not on this page · raw message
include/hw/i386/pc.h +2 -2
@@ -15,6 +15,7 @@#include "hw/pci/pci.h" #include "hw/boards.h" #include "hw/compat.h" +#include "hw/mem/pc-dimm.h" #define HPET_INTCAP "hpet-intcap"
@@ -32,8 +33,7 @@ struct PCMachineState {MachineState parent_obj;/* <public> */ -ram_addr_t hotplug_memory_base; -MemoryRegion hotplug_memory; +MemoryHotplugState hotplug_memory;HotplugHandler *acpi_dev;ISADevice *rtc;
include/hw/mem/pc-dimm.h +9 -0
@@ -70,6 +70,11 @@ typedef struct PCDIMMDeviceClass { MemoryRegion *(*get_memory_region)(PCDIMMDevice *dimm); } PCDIMMDeviceClass; +typedef struct MemoryHotplugState { +ram_addr_t base; +MemoryRegion mr; +}MemoryHotplugState ; + uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, uint64_t address_space_size, uint64_t *hint, uint64_t align, uint64_t size,
@@ -79,4 +84,8 @@ int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp);int qmp_pc_dimm_device_list (Object *obj,void *opaque);uint64_t pc_existing_dimms_capacity (Error **errp); +void pc_dimm_memory_plug (DeviceState *dev,MemoryHotplugState *hpms, +MemoryRegion *mr,uint64_t align,Error **errp); +void pc_dimm_memory_unplug (DeviceState *dev,MemoryHotplugState *hpms, +MemoryRegion *mr);#endif
Signature · 1 line
2.1.0
Re: [Qemu-devel] [RFC PATCH v1 1/4] pc, pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate routine
Quoted 6 lines · Bharata B Rao
pc_dimm_plug()has code that will be needed for memory plug handlers in other archs too. Extract code frompc_dimm_plug()into a generic routinepc_dimm_memory_plug()that resides inpc-dimm.c. Also correspondingly refactor re-usable unplug code intopc_dimm_memory_unplug().Signed-off-by Bharata B Rao <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
RFC PATCH 2/4 numa, pc-dimm: Store pc-dimm memory information in numa_info
In reply to Bharata B RaoStart storing the (start_addr, size, nodeid) of the pc-dimm memory in numa_info so that this information can be used to lookup node by address.
--- hw/mem/pc-dimm.c | 4 ++++ include/sysemu/numa.h | 10 ++++++++++ numa.c | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)
hw/mem/pc-dimm.c +4 -0
@@ -97,6 +97,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,memory_region_add_subregion (&hpms->mr, addr - hpms->base, mr);vmstate_register_ram (mr, dev); +numa_set_mem_node_id (addr,memory_region_size (mr), dimm->node); out:error_propagate (errp, local_err);
@@ -105,6 +106,9 @@ out:void pc_dimm_memory_unplug (DeviceState *dev,MemoryHotplugState *hpms,MemoryRegion *mr) { +PCDIMMDevice *dimm =PC_DIMM (dev); + +numa_unset_mem_node_id (dimm->addr,memory_region_size (mr), dimm->node);memory_region_del_subregion (&hpms->mr, mr);vmstate_unregister_ram (mr, dev); }
include/sysemu/numa.h +10 -0
@@ -10,16 +10,26 @@extern int nb_numa_nodes;/* Number of NUMA nodes */ +struct numa_addr_range { +ram_addr_t mem_start; +ram_addr_t mem_end; +QLIST_ENTRY (numa_addr_range) entry; +}; +typedef struct node_info {uint64_t node_mem; DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS);struct HostMemoryBackend *node_memdev;bool present; + QLIST_HEAD(, numa_addr_range) addr; /* List to store address ranges */ }NodeInfo ; +extern NodeInfo numa_info[MAX_NODES ];void parse_numa_opts (MachineClass *mc);void numa_post_machine_init (void );void query_numa_node_mem (uint64_t node_mem[]);extern QemuOptsList qemu_numa_opts; +void numa_set_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node); +void numa_unset_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node);#endif
numa.c +26 -0
@@ -53,6 +53,28 @@ static int max_numa_nodeid; /* Highest specified NUMA node ID, plus one.int nb_numa_nodes;NodeInfo numa_info[MAX_NODES ]; +void numa_set_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node) +{ +struct numa_addr_range *range =g_malloc0 (sizeof (*range)); + + range->mem_start = addr; + range->mem_end = addr + size; +QLIST_INSERT_HEAD (&numa_info[node].addr, range, entry); +} + +void numa_unset_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node) +{ +struct numa_addr_range *range, *next; + + QLIST_FOREACH_SAFE(range, &numa_info[node].addr, entry, next) { +if (addr == range->mem_start && (addr + size) == range->mem_end) { +QLIST_REMOVE (range, entry); +g_free (range); +return ; + } + } +} +static void numa_node_parse (NumaNodeOptions *node,QemuOpts *opts,Error **errp) {uint16_t nodenr;
@@ -275,6 +297,10 @@ void parse_numa_opts(MachineClass *mc) }for (i =0 ; i < nb_numa_nodes; i++) { +QLIST_INIT (&numa_info[i].addr); + } + +for (i =0 ; i < nb_numa_nodes; i++) {if (!bitmap_empty (numa_info[i].node_cpu,MAX_CPUMASK_BITS )) {break ; }
Signature · 1 line
2.1.0
Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info
Quoted 5 lines · Bharata B Rao
Start storing the (
start_addr, size, nodeid) of the pc-dimm memory innuma_infoso that this information can be used to lookup node by address.Signed-off-by Bharata B Rao <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info
In reply to Bharata B RaoQuoted 24 lines · On Fri, 12 Jun 2015 14:30:26 +0530 Bharata B Rao <[email protected]>…
Start storing the (
start_addr, size, nodeid) of the pc-dimm memory innuma_infoso that this information can be used to lookup node by address.Signed-off-by Bharata B Rao <[email protected]>--- hw/mem/pc-dimm.c | 4 ++++ include/sysemu/numa.h | 10 ++++++++++ numa.c | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)hw/mem/pc-dimm.c +1
-0@@ -97,6 +97,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,memory_region_add_subregion (&hpms->mr, addr - hpms->base, mr);vmstate_register_ram (mr, dev); +numa_set_mem_node_id (addr,memory_region_size (mr), dimm->node); out:error_propagate (errp, local_err);
hw/mem/pc-dimm.c out: · line 111
Quoted 6 lines
hw/mem/pc-dimm.c +3
-0@@ -105,6 +106,9 @@ out:void pc_dimm_memory_unplug (DeviceState *dev,MemoryHotplugState *hpms,MemoryRegion *mr) { +PCDIMMDevice *dimm =PC_DIMM (dev); + +numa_unset_mem_node_id (dimm->addr,memory_region_size (mr), dimm->node);
Wouldn't that cause pc-dimm range appear in SRAT table? Before this pc-dimm-s are only added as ACPI devices but don't advertised in SRAT ACPI table.
Perhaps make it up to target to decide if it want's to report dimms with numa_unset_mem_node_id() and not in generic code.
Quoted 78 lines
hw/mem/pc-dimm.c +0
-0memory_region_del_subregion (&hpms->mr, mr);vmstate_unregister_ram (mr, dev); }include/sysemu/numa.h +10
-0@@ -10,16 +10,26 @@extern int nb_numa_nodes;/* Number of NUMA nodes */ +struct numa_addr_range { +ram_addr_t mem_start; +ram_addr_t mem_end; +QLIST_ENTRY (numa_addr_range) entry; +}; +typedef struct node_info {uint64_t node_mem; DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS);struct HostMemoryBackend *node_memdev;bool present; + QLIST_HEAD(, numa_addr_range) addr; /* List to store address ranges */ }NodeInfo ; +extern NodeInfo numa_info[MAX_NODES ];void parse_numa_opts (MachineClass *mc);void numa_post_machine_init (void );void query_numa_node_mem (uint64_t node_mem[]);extern QemuOptsList qemu_numa_opts; +void numa_set_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node); +void numa_unset_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node);#endif numa.c +26
-0@@ -53,6 +53,28 @@ static int max_numa_nodeid; /* Highest specified NUMA node ID, plus one.int nb_numa_nodes;NodeInfo numa_info[MAX_NODES ]; +void numa_set_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node) +{ +struct numa_addr_range *range =g_malloc0 (sizeof (*range)); + + range->mem_start = addr; + range->mem_end = addr + size; +QLIST_INSERT_HEAD (&numa_info[node].addr, range, entry); +} + +void numa_unset_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node) +{ +struct numa_addr_range *range, *next; + + QLIST_FOREACH_SAFE(range, &numa_info[node].addr, entry, next) { +if (addr == range->mem_start && (addr + size) == range->mem_end) { +QLIST_REMOVE (range, entry); +g_free (range); +return ; + } + } +} +static void numa_node_parse (NumaNodeOptions *node,QemuOpts *opts,Error **errp) {uint16_t nodenr;@@ -275,6 +297,10 @@ void parse_numa_opts(MachineClass *mc) }for (i =0 ; i < nb_numa_nodes; i++) { +QLIST_INIT (&numa_info[i].addr); + } + +for (i =0 ; i < nb_numa_nodes; i++) {if (!bitmap_empty (numa_info[i].node_cpu,MAX_CPUMASK_BITS )) {break ; }
Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info
Quoted 24 lines · Igor Mammedov
Quoted 21 lines · On Fri, 12 Jun 2015 14:30:26 +0530 Bharata B Rao <[email protected]>…
Start storing the (
start_addr, size, nodeid) of the pc-dimm memory innuma_infoso that this information can be used to lookup node by address.Signed-off-by Bharata B Rao <[email protected]>--- hw/mem/pc-dimm.c | 4 ++++ include/sysemu/numa.h | 10 ++++++++++ numa.c | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)hw/mem/pc-dimm.c +1
-0@@ -97,6 +97,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,memory_region_add_subregion (&hpms->mr, addr - hpms->base, mr);vmstate_register_ram (mr, dev); +numa_set_mem_node_id (addr,memory_region_size (mr), dimm->node);
Quoted 10 lines
hw/mem/pc-dimm.c out: · line 111
Quoted 9 lines
hw/mem/pc-dimm.c +3
-0out:error_propagate (errp, local_err);@@ -105,6 +106,9 @@ out:void pc_dimm_memory_unplug (DeviceState *dev,MemoryHotplugState *hpms,MemoryRegion *mr) { +PCDIMMDevice *dimm =PC_DIMM (dev); + +numa_unset_mem_node_id (dimm->addr,memory_region_size (mr), dimm->node);Wouldn't that cause pc-dimm range appear in SRAT table?
I don't think so.
numa_set_mem_node_id() and numa_unset_mem_node_id() APIs store/remove address range and node id information of realized pc-dimm device in/from a linked list in numa_info structure so that we can lookup the node id for a given address from numa.c in a self-contained manner.
So unless I am missing something, I don't see this affecting ACPI/SRAT table in any way.
Quoted 5 lines
Before this pc-dimm-s are only added as ACPI devices but don't advertised in SRAT ACPI table.
Perhaps make it up to target to decide if it want's to report dimms with
numa_unset_mem_node_id()and not in generic code.
Regards,
Bharata.
RFC PATCH 3/4 numa: Store boot memory address range in node_info
In reply to Bharata B RaoStore memory address range information of boot memory in address range list of numa_info.
This helps to have a common NUMA node lookup by address function that works for both boot time memory and hotplugged memory.
--- numa.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
numa.c +22 -0
@@ -75,6 +75,26 @@ void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) } } +static void numa_set_mem_ranges (void ) +{ +int i; +ram_addr_t mem_start, mem_end_prev; + +/* +* Deduce start address of each node and use it to store +* the address range info in numa_info address range list +*/ +for (i =0 ; i < nb_numa_nodes; i++) { +if (i) { + mem_start = mem_end_prev; + }else { + mem_start =0 ; + } + mem_end_prev = mem_start + numa_info[i].node_mem; +numa_set_mem_node_id (mem_start, numa_info[i].node_mem, i); + } +} +static void numa_node_parse (NumaNodeOptions *node,QemuOpts *opts,Error **errp) {uint16_t nodenr;
@@ -300,6 +320,8 @@ void parse_numa_opts(MachineClass *mc)QLIST_INIT (&numa_info[i].addr); } +numa_set_mem_ranges (); +for (i =0 ; i < nb_numa_nodes; i++) {if (!bitmap_empty (numa_info[i].node_cpu,MAX_CPUMASK_BITS )) {break ;
Signature · 1 line
2.1.0
Re: [Qemu-devel] [RFC PATCH v1 3/4] numa: Store boot memory address range in node_info
Quoted 7 lines · Bharata B Rao
Store memory address range information of boot memory in address range list of
numa_info.This helps to have a common NUMA node lookup by address function that works for both boot time memory and hotplugged memory.
Signed-off-by Bharata B Rao <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [RFC PATCH v1 3/4] numa: Store boot memory address range in node_info
In reply to Bharata B RaoQuoted 24 lines · Bharata B Rao
Store memory address range information of boot memory in address range list of
numa_info.This helps to have a common NUMA node lookup by address function that works for both boot time memory and hotplugged memory.
Signed-off-by Bharata B Rao <[email protected]>--- numa.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)numa.c +5
-0@@ -75,6 +75,26 @@ void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) } } +static void numa_set_mem_ranges (void ) +{ +int i; +ram_addr_t mem_start, mem_end_prev; +
numa.c void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) · line 92
Quoted 10 lines
numa.c +10
-0+/* +* Deduce start address of each node and use it to store +* the address range info in numa_info address range list +*/ +for (i =0 ; i < nb_numa_nodes; i++) { +if (i) { + mem_start = mem_end_prev; + }else { + mem_start =0 ; + }
You could simply initialize mem_end_prev=0 before entering the loop, instead.
Actually, you don't even need the mem_end_prev variable:
int i;
ram_addr_t mem_start = 0;
for (i = 0; i < nb_numa_nodes; i++) {
numa_set_mem_node_id(mem_start, numa_info[i].node_mem, i);
mem_start = mem_start + numa_info[i].node_mem;
}I was going to suggest moving this to memory_region_allocate_system_memory() instead (that already has a loop calculating the start address for each NUMA node), but the problem is that allocate_system_memory_nonnuma() may be called even if using NUMA if no memdevs are used. So this can be done later, after refactoring memory_region_allocate_system_memory() to have a single memory allocation code path.
Quoted 20 lines
numa.c +7
-0+ mem_end_prev = mem_start + numa_info[i].node_mem; +numa_set_mem_node_id (mem_start, numa_info[i].node_mem, i); + } +} +static void numa_node_parse (NumaNodeOptions *node,QemuOpts *opts,Error **errp) {uint16_t nodenr;@@ -300,6 +320,8 @@ void parse_numa_opts(MachineClass *mc)QLIST_INIT (&numa_info[i].addr); } +numa_set_mem_ranges (); +for (i =0 ; i < nb_numa_nodes; i++) {if (!bitmap_empty (numa_info[i].node_cpu,MAX_CPUMASK_BITS )) {break ;Signature · 1 line
2.1.0
Signature · 1 line
Eduardo
Re: [Qemu-devel] [RFC PATCH v1 3/4] numa: Store boot memory address range in node_info
Quoted 41 lines · Eduardo Habkost
Quoted 24 lines · Bharata B Rao
Store memory address range information of boot memory in address range list of
numa_info.This helps to have a common NUMA node lookup by address function that works for both boot time memory and hotplugged memory.
Signed-off-by Bharata B Rao <[email protected]>--- numa.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)numa.c +5
-0@@ -75,6 +75,26 @@ void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) } } +static void numa_set_mem_ranges (void ) +{ +int i; +ram_addr_t mem_start, mem_end_prev; +numa.c void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) · line 92
Quoted 10 lines
numa.c +10
-0+/* +* Deduce start address of each node and use it to store +* the address range info in numa_info address range list +*/ +for (i =0 ; i < nb_numa_nodes; i++) { +if (i) { + mem_start = mem_end_prev; + }else { + mem_start =0 ; + }You could simply initialize mem_end_prev=0 before entering the loop, instead.
Actually, you don't even need the
mem_end_prevvariable:
Quoted 7 lines
int i;
ram_addr_t mem_start = 0;
for (i = 0; i < nb_numa_nodes; i++) {
numa_set_mem_node_id(mem_start, numa_info[i].node_mem, i);
mem_start = mem_start + numa_info[i].node_mem;
}Ok will change to this.
Quoted 8 lines
I was going to suggest moving this to
memory_region_allocate_system_memory()instead (that already has a loop calculating the start address for each NUMA node), but the problem is thatallocate_system_memory_nonnuma()may be called even if using NUMA if no memdevs are used. So this can be done later, after refactoringmemory_region_allocate_system_memory()to have a single memory allocation code path.
If there are no more comments to be addressed in this series, I shall spin the next version.
Regards,
Bharata.
RFC PATCH 4/4 numa: API to lookup NUMA node by address
In reply to Bharata B RaoIntroduce an API numa_get_node(ram_addr_t addr, Error **errp) that returns the NUMA node to which the given address belongs to. This API works uniformly for both boot time as well as hotplugged memory.
This API is needed by sPAPR PowerPC to support ibm,dynamic-reconfiguration-memory device tree node which is needed for memory hotplug.
--- include/sysemu/numa.h | 1 + numa.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
include/sysemu/numa.h +1 -0
@@ -31,5 +31,6 @@ void query_numa_node_mem(uint64_t node_mem[]);extern QemuOptsList qemu_numa_opts;void numa_set_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node);void numa_unset_mem_node_id (ram_addr_t addr,uint64_t size,uint32_t node); +uint32_t numa_get_node (ram_addr_t addr,Error **errp);#endif
numa.c +34 -0
@@ -95,6 +95,40 @@ static void numa_set_mem_ranges(void) } } +/* +* Check if @addr falls under NUMA @node. +*/ +static bool numa_addr_belongs_to_node (ram_addr_t addr,uint32_t node) +{ +struct numa_addr_range *range; + + QLIST_FOREACH(range, &numa_info[node].addr, entry) { +if (addr >= range->mem_start && addr < range->mem_end) { +return true; + } + } +return false; +} + +/* +* Given an address, return the index of the NUMA node to which the +* address belongs to. +*/ +uint32_t numa_get_node (ram_addr_t addr,Error **errp) +{ +uint32_t i; + +for (i =0 ; i < nb_numa_nodes; i++) { +if (numa_addr_belongs_to_node (addr, i)) { +return i; + } + } + +error_setg (errp,"Address 0x" RAM_ADDR_FMT " doesn't belong to any " +"NUMA node" , addr); +return -1 ; +} +static void numa_node_parse (NumaNodeOptions *node,QemuOpts *opts,Error **errp) {uint16_t nodenr;
Signature · 1 line
2.1.0
Re: [Qemu-devel] [RFC PATCH v1 4/4] numa: API to lookup NUMA node by address
Quoted 9 lines · Bharata B Rao
Introduce an API
numa_get_node(ram_addr_t addr, Error **errp)that returns the NUMA node to which the given address belongs to. This API works uniformly for both boot time as well as hotplugged memory.This API is needed by sPAPR PowerPC to support ibm,dynamic-reconfiguration-memory device tree node which is needed for memory hotplug.
Signed-off-by Bharata B Rao <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson