From: Markus Armbruster <armbru@redhat.com>
To: Andrei Gudkov <gudkov.andrei@huawei.com>
Cc: <qemu-devel@nongnu.org>, <eduardo@habkost.net>,
<marcel.apfelbaum@gmail.com>, <philmd@linaro.org>,
<wangyanan55@huawei.com>, <eblake@redhat.com>
Subject: Re: [PATCH] [query-memory-size-summary] Report page size
Date: Thu, 25 May 2023 16:55:48 +0200 [thread overview]
Message-ID: <87jzwwo3yj.fsf@pond.sub.org> (raw)
In-Reply-To: <3200757e8218f65f873e79ab84a4b8382fbfa099.1684483058.git.gudkov.andrei@huawei.com> (Andrei Gudkov's message of "Fri, 19 May 2023 11:10:30 +0300")
Andrei Gudkov <gudkov.andrei@huawei.com> writes:
> Some commands (query-migrate and calc-dirty-rate) report values
> in units of pages. However, currently the only place where we can
> get page size is through query-migrate and only after migration
> has started. query-memory-size-summary seems like an appropritate
> place where it should be reported instead.
>
> Signed-off-by: Andrei Gudkov <gudkov.andrei@huawei.com>
> ---
> qapi/machine.json | 8 ++++++--
> hw/core/machine-qmp-cmds.c | 3 +++
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 37660d8f2a..10b2d686da 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1125,10 +1125,13 @@
##
# @MemoryInfo:
#
# Actual memory information in bytes.
#
# @base-memory: size of "base" memory specified with command line
# option -m.
#
# @plugged-memory: size of memory that can be hot-unplugged. This
> # field is omitted if target doesn't support memory hotplug (i.e.
> # CONFIG_MEM_DEVICE not defined at build time).
> #
> +# @page-size: the number of bytes per target page (since 8.1)
Recommend "size of target page in bytes" for consistency with the other
two sizes.
Machines may have multiple page sizes. Should we discuss that here?
> +#
> # Since: 2.11
> ##
> { 'struct': 'MemoryInfo',
> - 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } }
> + 'data' : { 'base-memory': 'size', '*plugged-memory': 'size',
> + 'page-size': 'size' } }
>
> ##
> # @query-memory-size-summary:
> @@ -1139,7 +1142,8 @@
> # Example:
> #
> # -> { "execute": "query-memory-size-summary" }
> -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
> +# <- { "return": { "page-size": 4096, "base-memory": 34359738368,
> +# "plugged-memory": 0 } }
> #
> # Since: 2.11
> ##
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 3860a50c3b..b768ff372f 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -27,6 +27,7 @@
> #include "sysemu/numa.h"
> #include "sysemu/runstate.h"
> #include "sysemu/sysemu.h"
> +#include "exec/target_page.h"
>
> /*
> * fast means: we NEVER interrupt vCPU threads to retrieve
> @@ -289,6 +290,8 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp)
> mem_info->has_plugged_memory =
> mem_info->plugged_memory != (uint64_t)-1;
>
> + mem_info->page_size = qemu_target_page_size();
> +
> return mem_info;
> }
next prev parent reply other threads:[~2023-05-25 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-19 8:10 [PATCH] [query-memory-size-summary] Report page size Andrei Gudkov via
2023-05-19 15:22 ` Eric Blake
2023-05-25 14:55 ` Markus Armbruster [this message]
2023-05-27 7:05 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzwwo3yj.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=gudkov.andrei@huawei.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.