[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/3] cpus-common: implement dirty limit on vCPU

From: Hyman
Subject: Re: [PATCH v3 3/3] cpus-common: implement dirty limit on vCPU
Date: Tue, 23 Nov 2021 01:31:04 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

在 2021/11/22 19:26, Markus Armbruster 写道:
Hyman Huang <huangy81@chinatelecom.cn> writes:

在 2021/11/22 17:10, Markus Armbruster 写道:
Hyman Huang <huangy81@chinatelecom.cn> writes:

=E5=9C=A8 2021/11/22 15:35, Markus Armbruster =E5=86=99=E9=81=93:
huangy81@chinatelecom.cn writes:

From: Hyman Huang(=E9=BB=84=E5=8B=87) <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.

Please start sentences with a capital letter.

Ok,i'll check the syntax problem next version.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>


diff --git a/qapi/misc.json b/qapi/misc.json
index 358548a..98e6001 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -527,3 +527,42 @@
     'data': { '*option': 'str' },
     'returns': ['CommandLineOptionInfo'],
     'allow-preconfig': true }
+# @set-dirty-limit:
+# This command could be used to cap the vCPU memory load, which is also
+# refered as dirtyrate. One should use "calc-dirty-rate" with "dirty-ring"
+# and to calculate vCPU dirtyrate and query it with "query-dirty-rate".
+# Once getting the vCPU current dirtyrate, "set-dirty-limit" can be used
+# to set the upper limit of dirtyrate for the interested vCPU.

"dirtyrate" is not a word.  Let's spell it "dirty page rate", for
consistency with the documentation in migration.json.
Ok, sounds good.

Regarding "One should use ...": sounds like you have to run
calc-dirty-rate with argument @mode set to @dirty-ring before this
command.  Correct?  What happens when you don't?  set-dirty-limit fails?
You didn't answer this question.
set-dirty-limit doesn't do any pre-check about if calc-dirty-rate has
executed, so it doesn't fail.

Peeking at qmp_set_dirty_limit()... it fails when
!kvm_dirty_ring_enabled().  kvm_dirty_ring_enabled() returns true when
kvm_state->kvm_dirty_ring_size is non-zero.  How can it become non-zero?
If we enable dirty-ring with qemu commandline "-accel kvm,dirty-ring-size=xxx",qemu will parse the dirty-ring-size and set it. So we check if
dirty-ring is enabled by the kvm_dirty_ring_size.

Since only executing calc-dirty-rate with dirty-ring mode can we get
the vCPU dirty page rate currently(while the dirty-bitmap only get the
vm dirty page rate), "One should use ..." maybe misleading, what i
actually want to say is "One should use the dirty-ring mode to
calculate the vCPU dirty page rate".

I'm still confused on what exactly users must do for the page dirty rate
limiting to work as intended, and at least as importantly, what happens
when they get it wrong.
User can set-dirty-limit unconditionally and the dirtylimit will work.

"One should use ..." just emphasize if users want to know which vCPU is in high memory load and want to limit it's dirty page rate, they can use calc-dirty-rate but it is not prerequisite for set-dirty-limit.

Umm, I think "One should use ..." explanation make things complicated.
I'll reconsider the comment next version.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]