[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/12] NUMA: Replace MAX_NODES with nb_numa_nodes in
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 10/12] NUMA: Replace MAX_NODES with nb_numa_nodes in for loop |
Date: |
Tue, 19 Sep 2017 17:18:48 -0300 |
From: Dou Liyang <address@hidden>
In QEMU, the number of the NUMA nodes is determined by parse_numa_opts().
Then, QEMU uses it for iteration, for example:
for (i = 0; i < nb_numa_nodes; i++)
However, in memory_region_allocate_system_memory(), it uses MAX_NODES
not nb_numa_nodes.
So, replace MAX_NODES with nb_numa_nodes to keep code consistency and
reduce the loop times.
Signed-off-by: Dou Liyang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/numa.c b/numa.c
index fe066ad2f8..100a67febf 100644
--- a/numa.c
+++ b/numa.c
@@ -567,7 +567,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr,
Object *owner,
}
memory_region_init(mr, owner, name, ram_size);
- for (i = 0; i < MAX_NODES; i++) {
+ for (i = 0; i < nb_numa_nodes; i++) {
uint64_t size = numa_info[i].node_mem;
HostMemoryBackend *backend = numa_info[i].node_memdev;
if (!backend) {
--
2.13.5
- [Qemu-devel] [PULL 00/12] Machine/CPU/NUMA queue, 2017-09-19, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 01/12] vl: Clean up user-creatable objects when exiting, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 02/12] osdep: Define QEMU_MADV_REMOVE, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 03/12] hostmem-file: Add "discard-data" option, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 04/12] qom: cpus: split cpu_generic_init() on feature parsing and cpu creation parts, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 05/12] cpu: make cpu_generic_init() abort QEMU on error, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 06/12] vl.c: convert cpu_model to cpu type and set of global properties before machine_init(), Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 07/12] pc: use generic cpu_model parsing, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 08/12] arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 09/12] numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 10/12] NUMA: Replace MAX_NODES with nb_numa_nodes in for loop,
Eduardo Habkost <=
- [Qemu-devel] [PULL 11/12] hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 12/12] MAINTAINERS: Update git URLs for my trees, Eduardo Habkost, 2017/09/19
- Re: [Qemu-devel] [PULL 00/12] Machine/CPU/NUMA queue, 2017-09-19, Peter Maydell, 2017/09/20