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 v2 3/3] cpus-common: implement dirty limit on vCPU
Date: Sat, 20 Nov 2021 08:57:36 +0100 [thread overview]
Message-ID: <87fsrrz2bz.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1d7b72b34a97fcd8ece586a4671abc0916fc67ee.1637258578.git.huangy81@chinatelecom.cn> (huangy's message of "Fri, 19 Nov 2021 02:17:03 +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
> dirtyrate given by user.
>
> introduce qmp commands set-dirty-limit/cancel-dirty-limit to
> set/cancel dirty limit on vCPU.
>
> Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
[...]
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index e948e81..dd65e9e 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -881,6 +881,13 @@ void end_exclusive(void);
> */
> void qemu_init_vcpu(CPUState *cpu);
>
> +/**
> + * dirtylimit_setup:
> + *
> + * dirtylimit setup.
> + */
This is even worse than no documentation.
> +void dirtylimit_setup(int max_cpus);
> +
> #define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */
> #define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */
> #define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 358548a..7f6da34 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -527,3 +527,47 @@
> 'data': { '*option': 'str' },
> 'returns': ['CommandLineOptionInfo'],
> 'allow-preconfig': true }
> +
> +##
> +# @DirtyRateQuotaVcpu:
> +#
> +# Dirty rate of vcpu.
> +#
> +# @idx: vcpu index.
> +#
> +# @dirtyrate: dirty rate.
> +#
> +# Since: 6.3
> +#
> +##
> +{ 'struct': 'DirtyRateQuotaVcpu',
> + 'data': { 'idx': 'int', 'dirtyrate': 'uint64' } }
> +
> +##
> +# @set-dirty-limit:
> +#
> +# Since: 6.3
> +#
> +# Example:
> +# {"execute": "set-dirty-limit"}
> +# "arguments": { "idx": "cpu-index",
> +# "dirtyrate": "quota-dirtyrate" } }
The example cannot work: the arguments must be numbers, not strings.
> +#
> +##
> +{ 'command': 'set-dirty-limit',
> + 'data': 'DirtyRateQuotaVcpu' }
Why make DirtyRateQuotaVcpu a separate type? Why not
{ 'command': 'set-dirty-limit',
'data': { 'idx': 'int', 'dirtyrate': 'uint64' } }
> +
> +##
> +# @cancel-dirty-limit:
> +#
> +# @idx: index of vCPU to be canceled
> +#
> +# Since: 6.3
> +#
> +# Example:
> +# {"execute": "cancel-dirty-limit"}
> +# "arguments": { "idx": "cpu-index" } }
> +#
> +##
> +{ 'command': 'cancel-dirty-limit',
> + 'data': { 'idx': 'int' } }
Overall, documentation is too terse. What is a "dirty rate of vcpu",
and why should I care? Is it related to query-dirty-rate?
Nitpick: you use both "vcpu" and "vCPU" in comments. Stick to the
latter, please.
[...]
prev parent reply other threads:[~2021-11-20 7:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 18:17 [PATCH v2 0/3] support dirty restraint on vCPU huangy81
[not found] ` <cover.1637258578.git.huangy81@chinatelecom.cn>
2021-11-18 18:17 ` [PATCH v2 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically huangy81
2021-11-18 18:17 ` [PATCH v2 2/3] cpu-throttle: implement vCPU throttle huangy81
2021-11-18 18:17 ` [PATCH v2 3/3] cpus-common: implement dirty limit on vCPU huangy81
2021-11-20 7:57 ` Markus Armbruster [this message]
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=87fsrrz2bz.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.