From: Peter Xu <peterx@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Chuan Zheng <zhengchuan@huawei.com>,
Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
huangy81@chinatelecom.cn, qemu-devel@nongnu.org,
Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds
Date: Wed, 9 Jun 2021 14:57:03 -0400 [thread overview]
Message-ID: <YMEO/xVyiiJLg32g@t490s> (raw)
In-Reply-To: <YL/Gtw64I0jbSXgn@work-vm>
On Tue, Jun 08, 2021 at 08:36:23PM +0100, Dr. David Alan Gilbert wrote:
> * Peter Xu (peterx@redhat.com) wrote:
> > On Tue, Jun 08, 2021 at 07:49:56PM +0100, Dr. David Alan Gilbert wrote:
> > > * Peter Xu (peterx@redhat.com) wrote:
> > > > These two commands are missing when adding the QMP sister commands. Add them,
> > > > so developers can play with them easier.
> > > >
> > > > Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > > > Cc: Juan Quintela <quintela@redhat.com>
> > > > Cc: Leonardo Bras Soares Passos <lsoaresp@redhat.com>
> > > > Cc: Chuan Zheng <zhengchuan@huawei.com>
> > > > Cc: huangy81@chinatelecom.cn
> > > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > >
> > > Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > >
> > > > ---
> > > > PS: I really doubt whether this is working as expected... I ran one 200MB/s
> > > > workload inside, what I measured is 20MB/s with current algorithm... Sampling
> > > > 512 pages out of 1G mem is not wise enough I guess, especially that assumes
> > > > dirty workload is spread across the memories while it's normally not the case..
> > >
> > > What size of address space did you dirty - was it 20MB?
> >
> > IIRC it was either 200M or 500M, based on a 1G small VM.
>
> What was your sample time ?
10 seconds; I used the same sample time for below runs:
https://lore.kernel.org/qemu-devel/YMEFqfYZVhsinNN+@t490s/
A large sample time does make dirty rate less indeed, as the same dirty page
could be written again as 1 single page dirtyed in the host (while it's counted
twice in the guest dirty workload).
This effect should happen too if we further extend calc_dirty_rate with
KVM_GET_DIRTY_LOG in the future as the 3rd method besides dirty ring.
From that pov, dirty ring is easier to be more "accurate" (I don't know whether
it's suitable to say it's accurate; it's just easier to trap cases like
writting to same page multiple times within a period), as the ring size is
normally very limited (e.g. 4096 pages per vcpu), so even the guest workload
writes the same page twice, as long as there's a ring collect between the two
writes, they'll be counted twice too (each collect will reprotect the pages).
--
Peter Xu
prev parent reply other threads:[~2021-06-09 18:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 0:57 [PATCH] hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds Peter Xu
2021-06-01 14:08 ` Hyman
2021-06-01 14:36 ` Peter Xu
2021-06-08 18:49 ` Dr. David Alan Gilbert
2021-06-08 19:19 ` Peter Xu
2021-06-08 19:36 ` Dr. David Alan Gilbert
2021-06-09 18:57 ` Peter Xu [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=YMEO/xVyiiJLg32g@t490s \
--to=peterx@redhat.com \
--cc=dgilbert@redhat.com \
--cc=huangy81@chinatelecom.cn \
--cc=lsoaresp@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhengchuan@huawei.com \
/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).