From: Markus Armbruster <armbru@redhat.com>
To: huangy81@chinatelecom.cn
Cc: "David Hildenbrand" <david@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Peter Xu" <peterx@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU
Date: Fri, 03 Dec 2021 13:34:12 +0100 [thread overview]
Message-ID: <87tufpyiij.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <9cc3cc5377e4330cbe0e87e89f452889516a4c09.1638495274.git.huangy81@chinatelecom.cn> (huangy's message of "Fri, 3 Dec 2021 09:39:47 +0800")
huangy81@chinatelecom.cn writes:
> From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
>
> Implement dirtyrate calculation periodically basing on
> dirty-ring and throttle vCPU until it reachs the quota
> dirty page rate given by user.
>
> Introduce qmp commands "vcpu-dirty-limit", "query-vcpu-dirty-limit"
> to enable, disable, query dirty page limit for virtual CPU.
>
> Meanwhile, introduce corresponding hmp commands "vcpu_dirty_limit",
> "info vcpu_dirty_limit" so developers can play with them easier.
>
> Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
[...]
I see you replaced the interface. Back to square one...
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 3da8fdf..dc15b3f 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1872,6 +1872,54 @@
> 'current-rate': 'int64' } }
>
> ##
> +# @vcpu-dirty-limit:
> +#
> +# Set or cancel the upper limit of dirty page rate for a virtual CPU.
> +#
> +# Requires KVM with accelerator property "dirty-ring-size" set.
> +# A virtual CPU's dirty page rate is a measure of its memory load.
> +# To observe dirty page rates, use @calc-dirty-rate.
> +#
> +# @cpu-index: index of virtual CPU.
> +#
> +# @enable: true to enable, false to disable.
> +#
> +# @dirty-rate: upper limit of dirty page rate for virtual CPU.
> +#
> +# Since: 7.0
> +#
> +# Example:
> +# {"execute": "vcpu-dirty-limit"}
> +# "arguments": { "cpu-index": 0,
> +# "enable": true,
> +# "dirty-rate": 200 } }
> +#
> +##
> +{ 'command': 'vcpu-dirty-limit',
> + 'data': { 'cpu-index': 'int',
> + 'enable': 'bool',
> + 'dirty-rate': 'uint64'} }
When @enable is false, @dirty-rate makes no sense and is not used (I
checked the code), but users have to specify it anyway. That's bad
design.
Better: drop @enable, make @dirty-rate optional, present means enable,
absent means disable.
> +
> +##
> +# @query-vcpu-dirty-limit:
> +#
> +# Returns information about the virtual CPU dirty limit status.
> +#
> +# @cpu-index: index of the virtual CPU to query, if not specified, all
> +# virtual CPUs will be queried.
> +#
> +# Since: 7.0
> +#
> +# Example:
> +# {"execute": "query-vcpu-dirty-limit"}
> +# "arguments": { "cpu-index": 0 } }
> +#
> +##
> +{ 'command': 'query-vcpu-dirty-limit',
> + 'data': { '*cpu-index': 'int' },
> + 'returns': [ 'DirtyLimitInfo' ] }
Why would anyone ever want to specify @cpu-index? Output isn't that
large even if you have a few hundred CPUs.
Let's keep things simple and drop the parameter.
> +
> +##
> # @snapshot-save:
> #
> # Save a VM snapshot
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 620a1f1..0f83ce3 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3777,5 +3777,6 @@ void qemu_init(int argc, char **argv, char **envp)
> qemu_init_displays();
> accel_setup_post(current_machine);
> os_setup_post();
> + dirtylimit_setup(current_machine->smp.max_cpus);
> resume_mux_open();
> }
next prev parent reply other threads:[~2021-12-03 12:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 1:39 [PATCH v9 0/3] support dirty restraint on vCPU huangy81
2021-12-03 1:39 ` [PATCH v9 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically huangy81
2021-12-06 10:18 ` Peter Xu
2021-12-06 15:36 ` Hyman
2021-12-03 1:39 ` [PATCH v9 2/3] cpu-throttle: implement vCPU throttle huangy81
2021-12-06 10:10 ` Peter Xu
2021-12-08 15:36 ` Hyman
2021-12-08 15:50 ` Hyman
2021-12-03 1:39 ` [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU huangy81
2021-12-03 12:34 ` Markus Armbruster [this message]
2021-12-04 12:00 ` Hyman Huang
2021-12-06 8:28 ` Peter Xu
2021-12-06 14:56 ` Hyman
2021-12-07 2:24 ` Peter Xu
2021-12-07 4:32 ` Hyman
2021-12-06 8:36 ` Peter Xu
2021-12-06 15:19 ` Hyman
2021-12-07 2:57 ` Peter Xu
2021-12-07 4:38 ` Hyman
2021-12-06 8:39 ` Peter Xu
2021-12-06 15:22 ` Hyman
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=87tufpyiij.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=huangy81@chinatelecom.cn \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
/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.