[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 20/22] numa: handle virtio-pmem in NUMA stats
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH v3 20/22] numa: handle virtio-pmem in NUMA stats |
Date: |
Fri, 21 Sep 2018 16:51:02 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
* David Hildenbrand (address@hidden) wrote:
> 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>
> ---
> numa.c | 25 +++++++++++++------------
> 1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/numa.c b/numa.c
> index 81542d4ebb..8aa9b21a22 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -544,30 +544,31 @@ 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;
> + PCDIMMDeviceInfo *pcdimm_info = NULL;
>
> 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;
> - }
Similar to my patch 19 comment about the fallthrough case
> - if (pcdimm_info) {
> + if (!pcdimm_info) {
> + pcdimm_info = 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 */
Ah, I guess that answers my question on the previous one :-)
Dave
> + node_mem[0].node_mem += vpi->size;
> + node_mem[0].node_plugged_mem += vpi->size;
> + default:
> + break;
> }
> }
> }
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype, (continued)
[Qemu-devel] [PATCH v3 18/22] virtio-pci: proxy for virtio-pmem, David Hildenbrand, 2018/09/20
[Qemu-devel] [PATCH v3 19/22] hmp: handle virtio-pmem when printing memory device infos, David Hildenbrand, 2018/09/20
[Qemu-devel] [PATCH v3 20/22] numa: handle virtio-pmem in NUMA stats, David Hildenbrand, 2018/09/20
- Re: [Qemu-devel] [PATCH v3 20/22] numa: handle virtio-pmem in NUMA stats,
Dr. David Alan Gilbert <=
[Qemu-devel] [PATCH v3 21/22] virtio-pmem: hotplug support functions, David Hildenbrand, 2018/09/20
[Qemu-devel] [PATCH v3 22/22] pc: support for virtio-pmem, David Hildenbrand, 2018/09/20