From: Peter Xu <peterx@redhat.com>
To: Hyman <huangy81@chinatelecom.cn>
Cc: "Juan Quintela" <quintela@redhat.com>,
"Markus ArmBruster" <armbru@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
"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: Tue, 7 Dec 2021 10:57:52 +0800 [thread overview]
Message-ID: <Ya7NhcagnW86DBVP@xz-m1.local> (raw)
In-Reply-To: <51937a31-4f8e-dc80-e731-cb026e42c1c9@chinatelecom.cn>
On Mon, Dec 06, 2021 at 11:19:21PM +0800, Hyman wrote:
> > > + if (has_cpu_index) {
> > > + info = dirtylimit_query_vcpu(cpu_index);
> > > + QAPI_LIST_APPEND(tail, info);
> > > + } else {
> > > + CPUState *cpu;
> > > + CPU_FOREACH(cpu) {
> > > + if (!cpu->unplug) {
> > > + info = dirtylimit_query_vcpu(cpu->cpu_index);
> > > + QAPI_LIST_APPEND(tail, info);
> > > + }
> >
> > There're special handling for unplug in a few places. Could you explain why?
> > E.g. if the vcpu is unplugged then dirty rate is zero, then it seems fine to
> > even keep it there?
> > The dirty limit logic only allow plugged vcpu to be enabled throttle, so
> that the "dirtylimit-{cpu-index}" thread don't need to be forked and we can
> save the overhead. So in query logic we just filter the unplugged vcpu.
I've commented similarly in the other thread - please consider not using NVCPU
threads only for vcpu throttling, irrelevant of vcpu hot plug/unplug.
Per-vcpu throttle is totally not a cpu intensive workload, 1 thread should be
enough globally, imho.
A guest with hundreds of vcpus are becoming more common, we shouldn't waste OS
thread resources just for this.
>
> Another reason is that i thought it could make user confused when we return
> the unplugged vcpu dirtylimit info. Uh, in most time of vm lifecycle,
> hotplugging vcpu may never happen.
I just think if plug/unplug does not affect the throttle logic then we should
treat them the same, it avoids unnecessary special care on those vcpus too.
--
Peter Xu
next prev parent reply other threads:[~2021-12-07 2:59 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
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 [this message]
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=Ya7NhcagnW86DBVP@xz-m1.local \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=huangy81@chinatelecom.cn \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).