[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/22] numa: Handle virtio-pmem in NUMA stats
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 10/22] numa: Handle virtio-pmem in NUMA stats |
Date: |
Tue, 2 Jul 2019 11:07:34 -0400 |
From: David Hildenbrand <address@hidden>
Account the memory to node 0 for now. Once (if ever) virtio-pmem
supports NUMA, we can account it to the right node.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
numa.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/numa.c b/numa.c
index 955ec0c830..cfcdb8d943 100644
--- a/numa.c
+++ b/numa.c
@@ -549,6 +549,7 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[])
MemoryDeviceInfoList *info_list = qmp_memory_device_list();
MemoryDeviceInfoList *info;
PCDIMMDeviceInfo *pcdimm_info;
+ VirtioPMEMDeviceInfo *vpi;
for (info = info_list; info; info = info->next) {
MemoryDeviceInfo *value = info->value;
@@ -556,22 +557,21 @@ static void numa_stat_memory_devices(NumaNodeMem
node_mem[])
if (value) {
switch (value->type) {
case MEMORY_DEVICE_INFO_KIND_DIMM:
- pcdimm_info = value->u.dimm.data;
- break;
-
case MEMORY_DEVICE_INFO_KIND_NVDIMM:
- pcdimm_info = value->u.nvdimm.data;
- break;
-
- default:
- pcdimm_info = NULL;
- break;
- }
-
- if (pcdimm_info) {
+ pcdimm_info = value->type == MEMORY_DEVICE_INFO_KIND_DIMM ?
+ value->u.dimm.data : value->u.nvdimm.data;
node_mem[pcdimm_info->node].node_mem += pcdimm_info->size;
node_mem[pcdimm_info->node].node_plugged_mem +=
pcdimm_info->size;
+ break;
+ case MEMORY_DEVICE_INFO_KIND_VIRTIO_PMEM:
+ vpi = value->u.virtio_pmem.data;
+ /* TODO: once we support numa, assign to right node */
+ node_mem[0].node_mem += vpi->size;
+ node_mem[0].node_plugged_mem += vpi->size;
+ break;
+ default:
+ g_assert_not_reached();
}
}
}
--
MST
- Re: [Qemu-devel] [PATCH v2 1/7] virtio-pmem: add virtio device, (continued)
- [Qemu-devel] [PULL 10/22] numa: Handle virtio-pmem in NUMA stats,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 09/22] hmp: Handle virtio-pmem when printing memory device infos, Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 11/22] pc: Support for virtio-pmem-pci, Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 12/22] virtio-pci: fix missing device properties, Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 13/22] virtio: add "use-started" property, Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 14/22] virtio: Set "start_on_kick" for legacy devices, Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 15/22] virtio: Set "start_on_kick" on virtio_set_features(), Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 16/22] virtio: Make sure we get correct state of device on handle_aio_output(), Michael S. Tsirkin, 2019/07/02
- [Qemu-devel] [PULL 17/22] virtio: Don't change "started" flag on virtio_vmstate_change(), Michael S. Tsirkin, 2019/07/02