All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Hyman Huang <huangy81@chinatelecom.cn>
Cc: "Juan Quintela" <quintela@redhat.com>,
	"David Hildenbrand" <david@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 v3 3/3] cpus-common: implement dirty limit on vCPU
Date: Mon, 22 Nov 2021 12:26:48 +0100	[thread overview]
Message-ID: <87wnl0l9c7.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <6a71b1a4-547a-aaef-2666-deabe4b7b410@chinatelecom.cn> (Hyman Huang's message of "Mon, 22 Nov 2021 17:25:11 +0800")

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?

> 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.

[...]



  reply	other threads:[~2021-11-22 11:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20 10:36 [PATCH v3 0/3] support dirty restraint on vCPU huangy81
2021-11-20 10:36 ` [PATCH v3 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically huangy81
2021-11-20 10:36 ` [PATCH v3 2/3] cpu-throttle: implement vCPU throttle huangy81
2021-11-20 10:36 ` [PATCH v3 3/3] cpus-common: implement dirty limit on vCPU huangy81
2021-11-22  7:35   ` Markus Armbruster
2021-11-22  8:19     ` Hyman Huang
2021-11-22  9:10       ` Markus Armbruster
2021-11-22  9:25         ` Hyman Huang
2021-11-22 11:26           ` Markus Armbruster [this message]
2021-11-22 17:31             ` 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=87wnl0l9c7.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.