All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Hyman Huang <huangy81@chinatelecom.cn>
Cc: "Eduardo Habkost" <eduardo@habkost.net>,
	"David Hildenbrand" <david@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Markus ArmBruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle
Date: Thu, 20 Jan 2022 18:58:55 +0800	[thread overview]
Message-ID: <YelAbyxRXDbRm8WC@xz-m1.local> (raw)
In-Reply-To: <53783d89-ee0c-0704-5bf2-a2552376bfec@chinatelecom.cn>

On Thu, Jan 20, 2022 at 06:03:45PM +0800, Hyman Huang wrote:
> 
> 
> 在 2022/1/20 17:25, Peter Xu 写道:
> > On Thu, Jan 20, 2022 at 04:26:09PM +0800, Hyman Huang wrote:
> > > Hi,Peter. I'm working on this problem and found the reason is kind of the
> > > same as i metioned in cover letter of v10, the following is what i posted:
> > > 
> > >    2. The new implementaion of throttle algo enlightened by Peter
> > >       responds faster and consume less cpu resource than the older,
> > >       we make a impressed progress.
> > > 
> > >       And there is a viewpoint may be discussed, it is that the new
> > >       throttle logic is "passive", vcpu sleeps only after dirty ring,
> > >       is full, unlike the "auto-converge" which will kick vcpu instead
> > >       in a fixed slice time. If the vcpu is memory-write intensive
> > >       and the ring size is large, it will produce dirty memory during
> > >       the dirty ring full time and the throttle works not so good, it
> > >       means the throttle depends on the dirty ring size.
> > > 
> > >       I actually tested the new algo in two case:
> > > 
> > >       case 1: dirty-ring-size: 4096, dirtyrate: 1170MB/s
> > >       result: minimum quota dirtyrate is 25MB/s or even less
> > >               minimum vcpu util is 6%
> > > 
> > >       case 2: dirty-ring-size: 65536, dirtyrate: 1170MB/s
> > >       result: minimum quota dirtyrate is 256MB/s
> > >               minimum vcpu util is 24%
> > > 
> > >       I post this just for discussion, i think this is not a big deal
> > >       beacase if we set the dirty-ring-size to the maximum value(65536),
> > >       we assume the server's bandwidth is capable of handling it.
> > 
> > My memory is that I tested your v10 (which has this wait-at-ring-full logic)
> > already and at that time it worked well.
> > 
> > It's possible that I just got lucky with v10, so that can happen with some
> > random conditions and so far we still don't know how to hit it.
> Uh, sorry for not explaining the reason clearly. I think the reason of
> failing to throttle is "vcpu loss chance to sleep", i trace the
> kvm_dirty_ring_full event and found that when throttling a vcpu works bad,
> the kvm_dirty_ring_full event do no arise and sleep never happens
> correspondingly.

I see, that's fine.  I think I'll just try the new version when it's ready.

> 
> Two case lead to this result:
> case 1: dirty-ring-size is large and the ring full time is long, not all
> dirty ring of vcpu get full at one time, so there must be some vcpus that
> miss the chance to sleep.
> 
> case 2: guest has many vcpus, not all dirty ring of vcpu get full at one
> time. So miss the chance of sleeping too as above.

I am just not sure whether my test case matches any of above: I'm using 4096
which is the smaller ring size, meanwhile I only have 1 busy dirty thread,
iirc.

-- 
Peter Xu



  reply	other threads:[~2022-01-20 11:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 17:14 [PATCH v11 0/4] support dirty restraint on vCPU huangy81
     [not found] ` <cover.1641316375.git.huangy81@chinatelecom.cn>
2022-01-04 17:14   ` [PATCH v11 1/4] migration/dirtyrate: refactor dirty page rate calculation huangy81
2022-01-17  2:19     ` Peter Xu
2022-01-22  3:22       ` Hyman Huang
2022-01-24  3:08         ` Peter Xu
2022-01-24  9:36           ` Hyman Huang
2022-01-04 17:14   ` [PATCH v11 2/4] softmmu/dirtylimit: implement vCPU dirtyrate calculation periodically huangy81
2022-01-17  2:31     ` Peter Xu
2022-01-04 17:14   ` [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle huangy81
2022-01-17  7:32     ` Peter Xu
2022-01-17 14:00       ` Hyman Huang
2022-01-18  1:00         ` Peter Xu
2022-01-18  2:08           ` Hyman Huang
2022-01-20  8:26       ` Hyman Huang
2022-01-20  9:25         ` Peter Xu
2022-01-20 10:03           ` Hyman Huang
2022-01-20 10:58             ` Peter Xu [this message]
2022-01-20 10:39           ` Hyman Huang
2022-01-20 10:56             ` Peter Xu
2022-01-20 11:03               ` Hyman Huang
2022-01-20 11:13                 ` Peter Xu
2022-01-21  8:07       ` Hyman Huang
2022-01-21  9:19         ` Peter Xu
2022-01-22  3:54       ` Hyman Huang
2022-01-24  3:10         ` Peter Xu
2022-01-24  4:20       ` Hyman Huang
2022-01-17  9:01     ` Peter Xu
2022-01-19 12:16     ` Markus Armbruster
2022-01-20 11:22       ` Hyman Huang
2022-01-04 17:14   ` [PATCH v11 4/4] softmmu/dirtylimit: implement dirty page rate limit huangy81
2022-01-17  7:35     ` Peter Xu
2022-01-19 12:16     ` Markus Armbruster
2022-01-17  8:54 ` [PATCH v11 0/4] support dirty restraint on vCPU Peter Xu

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=YelAbyxRXDbRm8WC@xz-m1.local \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eduardo@habkost.net \
    --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 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.