qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] numa: report all DIMM/NVDIMMs as plugged in "info numa"
@ 2018-06-28  9:00 David Hildenbrand
  2018-06-28  9:33 ` Igor Mammedov
  0 siblings, 1 reply; 2+ messages in thread
From: David Hildenbrand @ 2018-06-28  9:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Vadim Galitsyn, Igor Mammedov,
	Dr . David Alan Gilbert, Eugene Crosser, Markus Armbruster,
	Eric Blake, David Hildenbrand

Right now, there is some inconsistency between hotplugged and
coldplugged memory. DIMMs added via "-device" result in different stats
than DIMMs added using "device_add".

E.g. with the following QEMU cmdline:
    [...]
    -numa node,nodeid=0,cpus=0-1 -numa node,nodeid=1,cpus=2-3 \
    -m 4G,maxmem=20G,slots=2 \
    -object memory-backend-ram,id=mem0,size=8G \
    -device pc-dimm,id=dimm0,memdev=mem0 \
    -object memory-backend-ram,id=mem1,size=8G \
    -device nvdimm,id=dimm1,memdev=mem1,node=1

"info memory_size_summary" will correctly report:
    (qemu) info memory_size_summary
    info memory_size_summary
    base memory: 4294967296
    plugged memory: 17179869184

While "info numa" will not report DIMM/NVDIMMs as (cold)plugged memory.
    (qemu) info numa
    info numa
    2 nodes
    node 0 cpus: 0 1
    node 0 size: 10240 MB
    node 0 plugged: 0 MB
    node 1 cpus: 2 3
    node 1 size: 10240 MB
    node 1 plugged: 0 MB

Make this consistent by reporting all hot and coldplugged memory a.k.a.
DIMM and NVDIMM as "plugged".

With this change, the output of "info numa" is now:
    (qemu) info numa
    info numa
    2 nodes
    node 0 cpus: 0 1
    node 0 size: 10240 MB
    node 0 plugged: 8192 MB
    node 1 cpus: 2 3
    node 1 size: 10240 MB
    node 1 plugged: 8192 MB

Fixes: 31959e82fb0 ("hmp: extend "info numa" with hotplugged memory information")
Signed-off-by: David Hildenbrand <david@redhat.com>
---

v1 -> v2:
- Tweaked patch description/sibject as requested by Igor.

 numa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/numa.c b/numa.c
index 94f758c757..5f6367b989 100644
--- a/numa.c
+++ b/numa.c
@@ -566,10 +566,8 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[])
 
             if (pcdimm_info) {
                 node_mem[pcdimm_info->node].node_mem += pcdimm_info->size;
-                if (pcdimm_info->hotpluggable && pcdimm_info->hotplugged) {
-                    node_mem[pcdimm_info->node].node_plugged_mem +=
-                        pcdimm_info->size;
-                }
+                node_mem[pcdimm_info->node].node_plugged_mem +=
+                    pcdimm_info->size;
             }
         }
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH v2] numa: report all DIMM/NVDIMMs as plugged in "info numa"
  2018-06-28  9:00 [Qemu-devel] [PATCH v2] numa: report all DIMM/NVDIMMs as plugged in "info numa" David Hildenbrand
@ 2018-06-28  9:33 ` Igor Mammedov
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Mammedov @ 2018-06-28  9:33 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: qemu-devel, Eugene Crosser, Vadim Galitsyn, Markus Armbruster,
	Dr . David Alan Gilbert, Paolo Bonzini

On Thu, 28 Jun 2018 11:00:11 +0200
David Hildenbrand <david@redhat.com> wrote:

> Right now, there is some inconsistency between hotplugged and
> coldplugged memory. DIMMs added via "-device" result in different stats
> than DIMMs added using "device_add".
> 
> E.g. with the following QEMU cmdline:
>     [...]
>     -numa node,nodeid=0,cpus=0-1 -numa node,nodeid=1,cpus=2-3 \
>     -m 4G,maxmem=20G,slots=2 \
>     -object memory-backend-ram,id=mem0,size=8G \
>     -device pc-dimm,id=dimm0,memdev=mem0 \
>     -object memory-backend-ram,id=mem1,size=8G \
>     -device nvdimm,id=dimm1,memdev=mem1,node=1
> 
> "info memory_size_summary" will correctly report:
>     (qemu) info memory_size_summary
>     info memory_size_summary
>     base memory: 4294967296
>     plugged memory: 17179869184
> 
> While "info numa" will not report DIMM/NVDIMMs as (cold)plugged memory.
>     (qemu) info numa
>     info numa
>     2 nodes
>     node 0 cpus: 0 1
>     node 0 size: 10240 MB
>     node 0 plugged: 0 MB
>     node 1 cpus: 2 3
>     node 1 size: 10240 MB
>     node 1 plugged: 0 MB
> 
> Make this consistent by reporting all hot and coldplugged memory a.k.a.
> DIMM and NVDIMM as "plugged".
> 
> With this change, the output of "info numa" is now:
>     (qemu) info numa
>     info numa
>     2 nodes
>     node 0 cpus: 0 1
>     node 0 size: 10240 MB
>     node 0 plugged: 8192 MB
>     node 1 cpus: 2 3
>     node 1 size: 10240 MB
>     node 1 plugged: 8192 MB
> 
> Fixes: 31959e82fb0 ("hmp: extend "info numa" with hotplugged memory information")
> Signed-off-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
> 
> v1 -> v2:
> - Tweaked patch description/sibject as requested by Igor.
> 
>  numa.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/numa.c b/numa.c
> index 94f758c757..5f6367b989 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -566,10 +566,8 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[])
>  
>              if (pcdimm_info) {
>                  node_mem[pcdimm_info->node].node_mem += pcdimm_info->size;
> -                if (pcdimm_info->hotpluggable && pcdimm_info->hotplugged) {
> -                    node_mem[pcdimm_info->node].node_plugged_mem +=
> -                        pcdimm_info->size;
> -                }
> +                node_mem[pcdimm_info->node].node_plugged_mem +=
> +                    pcdimm_info->size;
>              }
>          }
>      }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-28  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28  9:00 [Qemu-devel] [PATCH v2] numa: report all DIMM/NVDIMMs as plugged in "info numa" David Hildenbrand
2018-06-28  9:33 ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).