[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/16] numa: Handle virtio-mem in NUMA stats
From: |
David Hildenbrand |
Subject: |
[PATCH v2 04/16] numa: Handle virtio-mem in NUMA stats |
Date: |
Wed, 12 Feb 2020 14:35:49 +0100 |
Account the memory to the configured nide.
Signed-off-by: David Hildenbrand <address@hidden>
---
hw/core/numa.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 601cf9f603..4deb27ebee 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -855,10 +855,11 @@ static void numa_stat_memory_devices(NumaNodeMem
node_mem[])
{
MemoryDeviceInfoList *info_list = qmp_memory_device_list();
MemoryDeviceInfoList *info;
- PCDIMMDeviceInfo *pcdimm_info;
VirtioPMEMDeviceInfo *vpi;
+ VirtioMEMDeviceInfo *vmi;
for (info = info_list; info; info = info->next) {
+ PCDIMMDeviceInfo *pcdimm_info = NULL;;
MemoryDeviceInfo *value = info->value;
if (value) {
@@ -877,6 +878,11 @@ static void numa_stat_memory_devices(NumaNodeMem
node_mem[])
node_mem[0].node_mem += vpi->size;
node_mem[0].node_plugged_mem += vpi->size;
break;
+ case MEMORY_DEVICE_INFO_KIND_VIRTIO_MEM:
+ vmi = value->u.virtio_mem.data;
+ node_mem[vmi->node].node_mem += vmi->size;
+ node_mem[vmi->node].node_plugged_mem += vmi->size;
+ break;
default:
g_assert_not_reached();
}
--
2.24.1
- [PATCH v2 00/16] Ram blocks with resizable anonymous allocations under POSIX, David Hildenbrand, 2020/02/12
- [PATCH v2 02/16] virtio-pci: Proxy for virtio-mem, David Hildenbrand, 2020/02/12
- [PATCH v2 01/16] virtio-mem: Prototype, David Hildenbrand, 2020/02/12
- [PATCH v2 03/16] hmp: Handle virtio-mem when printing memory device infos, David Hildenbrand, 2020/02/12
- [PATCH v2 04/16] numa: Handle virtio-mem in NUMA stats,
David Hildenbrand <=
- [PATCH v2 05/16] pc: Support for virtio-mem-pci, David Hildenbrand, 2020/02/12
- [PATCH v2 06/16] exec: Provide owner when resizing memory region, David Hildenbrand, 2020/02/12
- [PATCH v2 07/16] memory: Add memory_region_max_size() and memory_region_is_resizable(), David Hildenbrand, 2020/02/12
- [PATCH v2 08/16] memory: Disallow resizing to 0, David Hildenbrand, 2020/02/12
- [PATCH v2 09/16] memory-device: properly deal with resizable memory regions, David Hildenbrand, 2020/02/12
- [PATCH v2 10/16] hostmem: Factor out applying settings, David Hildenbrand, 2020/02/12
- [PATCH v2 11/16] hostmem: Factor out common checks into host_memory_backend_validate(), David Hildenbrand, 2020/02/12
- [PATCH v2 12/16] hostmem: Introduce "managed-size" for memory-backend-ram, David Hildenbrand, 2020/02/12
- [PATCH v2 13/16] qmp/hmp: Expose "managed-size" for memory backends, David Hildenbrand, 2020/02/12