[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/37] numa: Keep track of NUMA nodes present on the
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 10/37] numa: Keep track of NUMA nodes present on the command-line |
Date: |
Sun, 29 Jun 2014 19:58:36 +0300 |
From: Eduardo Habkost <address@hidden>
Based on "enable sparse node numbering" patch from Nishanth Aravamudan,
but without the code to actually support sparse node IDs. This just adds
the code to keep track of present/non-present nodes on the command-line,
without changing any behavior.
Signed-off-by: Nishanth Aravamudan <address@hidden>
[Rename max_numa_node to max_numa_nodeid -Eduardo]
[Initialize max_numa_nodeid to 0 -Eduardo]
[Use MAX() macro when setting max_numa_nodeid -Eduardo]
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Hu Tao <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
include/sysemu/sysemu.h | 7 ++++++-
numa.c | 2 ++
vl.c | 3 +++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 285c45b..d8539fd 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -146,11 +146,16 @@ extern int mem_prealloc;
*/
#define MAX_CPUMASK_BITS 255
-extern int nb_numa_nodes;
+extern int nb_numa_nodes; /* Number of NUMA nodes */
+extern int max_numa_nodeid; /* Highest specified NUMA node ID, plus one.
+ * For all nodes, nodeid < max_numa_nodeid
+ */
+
typedef struct node_info {
uint64_t node_mem;
DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS);
struct HostMemoryBackend *node_memdev;
+ bool present;
} NodeInfo;
extern NodeInfo numa_info[MAX_NODES];
void set_numa_nodes(void);
diff --git a/numa.c b/numa.c
index 6c2eae7..db10f95 100644
--- a/numa.c
+++ b/numa.c
@@ -106,6 +106,8 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts
*opts, Error **errp)
numa_info[nodenr].node_mem = object_property_get_int(o, "size", NULL);
numa_info[nodenr].node_memdev = MEMORY_BACKEND(o);
}
+ numa_info[nodenr].present = true;
+ max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
}
int numa_init_func(QemuOpts *opts, void *opaque)
diff --git a/vl.c b/vl.c
index a1686ef..41ddcd2 100644
--- a/vl.c
+++ b/vl.c
@@ -196,6 +196,7 @@ static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
QTAILQ_HEAD_INITIALIZER(fw_boot_order);
int nb_numa_nodes;
+int max_numa_nodeid;
NodeInfo numa_info[MAX_NODES];
uint8_t qemu_uuid[16];
@@ -2984,10 +2985,12 @@ int main(int argc, char **argv, char **envp)
for (i = 0; i < MAX_NODES; i++) {
numa_info[i].node_mem = 0;
+ numa_info[i].present = false;
bitmap_zero(numa_info[i].node_cpu, MAX_CPUMASK_BITS);
}
nb_numa_nodes = 0;
+ max_numa_nodeid = 0;
nb_nics = 0;
bdrv_init_with_whitelist();
--
MST
- [Qemu-devel] [PULL 01/37] numa: fix comment, (continued)
- [Qemu-devel] [PULL 01/37] numa: fix comment, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 03/37] numa: fix comment, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 02/37] openrisc: fix comment, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 04/37] pc: Move q35 compat props to PC_COMPAT_*, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 06/37] mc146818rtc: add rtc-reset-reinjection QMP command, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 08/37] pc: make isapc and pc-0.10 to pc-0.13 have 1.7.0 memory layout, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 05/37] pc: Fix "prog_if" typo on PC_COMPAT_2_0, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 07/37] vhost-user: fix wrong ids in documentation, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 09/37] Allow mismatched virtio config-len, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 11/37] numa: Reject duplicate node IDs, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 10/37] numa: Keep track of NUMA nodes present on the command-line,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 12/37] numa: Reject configuration if not all node IDs are present, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 13/37] vhost-user: fix regions provied with VHOST_USER_SET_MEM_TABLE message, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 14/37] vhost-user: typo fixups, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 15/37] virtio-net: byteswap virtio-net header, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 17/37] virtio: introduce device specific migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 16/37] virtio-serial: don't migrate the config space, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 18/37] virtio-net: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 19/37] virtio-blk: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 20/37] virtio-serial: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 21/37] virtio-balloon: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29