Roman Kagan
2016-Mar-09 17:04 UTC
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
On Wed, Mar 09, 2016 at 05:41:39PM +0200, Michael S. Tsirkin wrote:> On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > > For (1) I've been trying to make a point that skipping clean pages is > > much more likely to result in noticable benefit than free pages only. > > I guess when you say clean you mean zero?No I meant clean, i.e. those that could be evicted from RAM without causing I/O.> Yea. In fact, one can zero out any number of pages > quickly by putting them in balloon and immediately > taking them out. > > Access will fault a zero page in, then COW kicks in.I must be missing something obvious, but how is that different from inflating and then immediately deflating the balloon?> We could have a new zero VQ (or some other option) > to pass these pages guest to host, but this only > works well if page size matches the host page size.I'm afraid I don't yet understand what kind of pages that would be and how they are different from ballooned pages. I still tend to think that ballooning is a sensible solution to the problem at hand; it's just the granularity that makes things slow and stands in the way. Roman.
Michael S. Tsirkin
2016-Mar-09 17:39 UTC
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
On Wed, Mar 09, 2016 at 08:04:39PM +0300, Roman Kagan wrote:> On Wed, Mar 09, 2016 at 05:41:39PM +0200, Michael S. Tsirkin wrote: > > On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > > > For (1) I've been trying to make a point that skipping clean pages is > > > much more likely to result in noticable benefit than free pages only. > > > > I guess when you say clean you mean zero? > > No I meant clean, i.e. those that could be evicted from RAM without > causing I/O.They must be migrated unless guest actually evicts them. It's not at all clear to me that it's always preferable to drop all clean pages from pagecache. It is clearly is going to slow the guest down significantly.> > Yea. In fact, one can zero out any number of pages > > quickly by putting them in balloon and immediately > > taking them out. > > > > Access will fault a zero page in, then COW kicks in. > > I must be missing something obvious, but how is that different from > inflating and then immediately deflating the balloon?It's exactly the same except - we do not initiate this from host - it's guest doing things for its own reasons - a bit less guest/host interaction this way> > We could have a new zero VQ (or some other option) > > to pass these pages guest to host, but this only > > works well if page size matches the host page size. > > I'm afraid I don't yet understand what kind of pages that would be and > how they are different from ballooned pages. > > I still tend to think that ballooning is a sensible solution to the > problem at hand;I think it is, too. This does not mean we can't improve things though. This patchset is reported to improve things, it should be split up so we improve them for everyone and not just one specific workload.> it's just the granularity that makes things slow and > stands in the way.So we could request a specific page size/alignment from guest. Send guest request to give us memory in aligned units of 2Mbytes, and then host can treat each of these as a single huge page.> Roman.-- MST
Rik van Riel
2016-Mar-09 19:38 UTC
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
On Wed, 2016-03-09 at 20:04 +0300, Roman Kagan wrote:> On Wed, Mar 09, 2016 at 05:41:39PM +0200, Michael S. Tsirkin wrote: > > On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > > > For (1) I've been trying to make a point that skipping clean > > > pages is > > > much more likely to result in noticable benefit than free pages > > > only. > > > > I guess when you say clean you mean zero? > > No I meant clean, i.e. those that could be evicted from RAM without > causing I/O. >Programs in the guest may have that memory mmapped. This could include things like libraries and executables. How do you deal with the guest page cache containing references to now non-existent memory? How do you re-populate the memory on the destination host? --? All rights reversed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: This is a digitally signed message part URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20160309/05543ec7/attachment-0001.sig>
Roman Kagan
2016-Mar-10 09:30 UTC
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
On Wed, Mar 09, 2016 at 02:38:52PM -0500, Rik van Riel wrote:> On Wed, 2016-03-09 at 20:04 +0300, Roman Kagan wrote: > > On Wed, Mar 09, 2016 at 05:41:39PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > > > > For (1) I've been trying to make a point that skipping clean > > > > pages is > > > > much more likely to result in noticable benefit than free pages > > > > only. > > > > > > I guess when you say clean you mean zero? > > > > No I meant clean, i.e. those that could be evicted from RAM without > > causing I/O. > > > > Programs in the guest may have that memory mmapped. > This could include things like libraries and executables. > > How do you deal with the guest page cache containing > references to now non-existent memory? > > How do you re-populate the memory on the destination > host?I guess the confusion is due to the context I stripped from the previous messages... Actually I've been talking about doing full-fledged balloon inflation before the migration, so, when it's deflated the guest will fault in that data from the filesystem as usual. Roman.
Roman Kagan
2016-Mar-10 10:21 UTC
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
On Wed, Mar 09, 2016 at 07:39:18PM +0200, Michael S. Tsirkin wrote:> On Wed, Mar 09, 2016 at 08:04:39PM +0300, Roman Kagan wrote: > > On Wed, Mar 09, 2016 at 05:41:39PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > > > > For (1) I've been trying to make a point that skipping clean pages is > > > > much more likely to result in noticable benefit than free pages only. > > > > > > I guess when you say clean you mean zero? > > > > No I meant clean, i.e. those that could be evicted from RAM without > > causing I/O. > > They must be migrated unless guest actually evicts them.If the balloon is inflated the guest will.> It's not at all clear to me that it's always preferable > to drop all clean pages from pagecache. It is clearly is > going to slow the guest down significantly.That's a matter for optimization. The current value for /proc/meminfo:MemAvailable (which is being proposed as a member of balloon stats, too) is a conservative estimate which will probably cover a good deal of cases.> > I must be missing something obvious, but how is that different from > > inflating and then immediately deflating the balloon? > > It's exactly the same except > - we do not initiate this from host - it's guest doing > things for its own reasons > - a bit less guest/host interaction this wayI don't quite understand why you need to deflate the balloon until the VM is on the destination host. deflate_on_oom will do it if the guest is really tight on memory; otherwise there appears to be no reason for it. But then inflation followed immediately by deflation doubles the guest/host interactions rather than reduces them, no?> > it's just the granularity that makes things slow and > > stands in the way. > > So we could request a specific page size/alignment from guest. > Send guest request to give us memory in aligned units of 2Mbytes, > and then host can treat each of these as a single huge page.I'd guess just coalescing contiguous pages would already speed things up. I'll try to find some time to experiment with it. Roman.
Apparently Analagous Threads
- [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
- [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
- [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
- [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
- [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization