[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 00/10] KVM: Dirty ring support (QEMU part)
From: |
Peter Xu |
Subject: |
Re: [PATCH v5 00/10] KVM: Dirty ring support (QEMU part) |
Date: |
Tue, 23 Mar 2021 10:34:29 -0400 |
Keqian,
On Tue, Mar 23, 2021 at 02:40:43PM +0800, Keqian Zhu wrote:
> >> The second question is that you observed longer migration time (55s->73s)
> >> when guest
> >> has 24G ram and dirty rate is 800M/s. I am not clear about the reason. As
> >> with dirty
> >> ring enabled, Qemu can get dirty info faster which means it handles dirty
> >> page more
> >> quick, and guest can be throttled which means dirty page is generated
> >> slower. What's
> >> the rationale for the longer migration time?
> >
> > Because dirty ring is more sensitive to dirty rate, while dirty bitmap is
> > more
> Emm... Sorry that I'm very clear about this... I think that higher dirty rate
> doesn't cause
> slower dirty_log_sync compared to that of legacy bitmap mode. Besides, higher
> dirty rate
> means we may have more full-exit, which can properly limit the dirty rate. So
> it seems that
> dirty ring "prefers" higher dirty rate.
When I measured the 800MB/s it's in the guest, after throttling.
Imagine another example: a VM has 1G memory keep dirtying with 10GB/s. Dirty
logging will need to collect even less for each iteration because memory size
shrinked, collect even less frequent due to the high dirty rate, however dirty
ring will use 100% cpu power to collect dirty pages because the ring keeps full.
>
> > sensitive to memory footprint. In above 24G mem + 800MB/s dirty rate
> > condition, dirty bitmap seems to be more efficient, say, collecting dirty
> > bitmap of 24G mem (24G/4K/8=0.75MB) for each migration cycle is fast enough.
> >
> > Not to mention that current implementation of dirty ring in QEMU is not
> > complete - we still have two more layers of dirty bitmap, so it's actually a
> > mixture of dirty bitmap and dirty ring. This series is more like a POC on
> > dirty ring interface, so as to let QEMU be able to run on KVM dirty ring.
> > E.g., we won't have hang issue when getting dirty pages since it's totally
> > async, however we'll still have some legacy dirty bitmap issues e.g. memory
> > consumption of userspace dirty bitmaps are still linear to memory footprint.
> The plan looks good and coordinated, but I have a concern. Our dirty ring
> actually depends
> on the structure of hardware logging buffer (PML buffer). We can't say it can
> be properly
> adapted to all kinds of hardware design in the future.
Sorry I don't get it - dirty ring can work with pure page wr-protect too?
>
> >
> > Moreover, IMHO another important feature that dirty ring provided is
> > actually
> > the full-exit, where we can pause a vcpu when it dirties too fast, while
> > other
> I think a proper pause time is hard to decide. Short time may have little
> effect
> of throttle, but long time may have heavy effect on guest. Do you have a good
> algorithm?
That's the next thing we can discuss. IMHO I think the dirty ring is nice
already because we can measure dirty rate per-vcpu, also we can throttle in
vcpu granule. That's something required for a good algorithm, say we shouldn't
block vcpu when there's small dirty rate, and in many cases that's the case for
e.g. UI threads. Any algorithm should be based on these facts.
Thanks,
--
Peter Xu