Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-10 Thread Michael S. Tsirkin
On Thu, Mar 10, 2016 at 01:41:16AM +, Li, Liang Z wrote: > > > > > > Yes, we really can teach qemu to skip these pages and it's not hard. > > > > > > The problem is the poor performance, this PV solution > > > > > > > > > > Balloon is always PV. And do not call patches solutions please. > > > >

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-10 Thread Roman Kagan
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 try

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-10 Thread Roman Kagan
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

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Li, Liang Z
> > > > > Yes, we really can teach qemu to skip these pages and it's not hard. > > > > > The problem is the poor performance, this PV solution > > > > > > > > Balloon is always PV. And do not call patches solutions please. > > > > > > > > > is aimed to make it more > > > > > efficient and reduce th

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Rik van Riel
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 re

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Michael S. Tsirkin
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 r

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Roman Kagan
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 yo

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Michael S. Tsirkin
On Wed, Mar 09, 2016 at 05:28:54PM +0300, Roman Kagan wrote: > On Mon, Mar 07, 2016 at 01:40:06PM +0200, Michael S. Tsirkin wrote: > > On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > > > No. And it's exactly what I mean. The ballooned memory is still > > > > > processed during li

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Michael S. Tsirkin
On Wed, Mar 09, 2016 at 03:27:54PM +, Li, Liang Z wrote: > > On Mon, Mar 07, 2016 at 01:40:06PM +0200, Michael S. Tsirkin wrote: > > > On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > > > > No. And it's exactly what I mean. The ballooned memory is still > > > > > > processed d

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Li, Liang Z
> On Mon, Mar 07, 2016 at 01:40:06PM +0200, Michael S. Tsirkin wrote: > > On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > > > No. And it's exactly what I mean. The ballooned memory is still > > > > > processed during live migration without skipping. The live > > > > > migration c

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Roman Kagan
On Mon, Mar 07, 2016 at 01:40:06PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > > No. And it's exactly what I mean. The ballooned memory is still > > > > processed during live migration without skipping. The live migration > > > > code is >

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Li, Liang Z
> On Fri, Mar 04, 2016 at 06:51:21PM +, Dr. David Alan Gilbert wrote: > > * Paolo Bonzini (pbonz...@redhat.com) wrote: > > > > > > > > > On 04/03/2016 15:26, Li, Liang Z wrote: > > > >> > > > > >> > The memory usage will keep increasing due to ever growing > > > >> > caches, etc, so you'll be l

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-09 Thread Roman Kagan
On Fri, Mar 04, 2016 at 06:51:21PM +, Dr. David Alan Gilbert wrote: > * Paolo Bonzini (pbonz...@redhat.com) wrote: > > > > > > On 04/03/2016 15:26, Li, Liang Z wrote: > > >> > > > >> > The memory usage will keep increasing due to ever growing caches, etc, > > >> > so > > >> > you'll be left

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-08 Thread Li, Liang Z
> On 04/03/2016 15:26, Li, Liang Z wrote: > >> > > >> > The memory usage will keep increasing due to ever growing caches, > >> > etc, so you'll be left with very little free memory fairly soon. > >> > > > I don't think so. > > > > Roman is right. For example, here I am looking at a 64 GB (physica

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-08 Thread Li, Liang Z
> On Fri, Mar 04, 2016 at 03:13:03PM +, Li, Liang Z wrote: > > > > Maybe I am not clear enough. > > > > > > > > I mean if we inflate balloon before live migration, for a 8GB > > > > guest, it takes > > > about 5 Seconds for the inflating operation to finish. > > > > > > And these 5 seconds are

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-08 Thread Michael S. Tsirkin
On Fri, Mar 04, 2016 at 03:13:03PM +, Li, Liang Z wrote: > > > Maybe I am not clear enough. > > > > > > I mean if we inflate balloon before live migration, for a 8GB guest, it > > > takes > > about 5 Seconds for the inflating operation to finish. > > > > And these 5 seconds are spent where? >

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-07 Thread Li, Liang Z
ion@lists.linux-foundation.org; r...@twiddle.net; r...@redhat.com > Subject: Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration > optimization > > On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > > No. And it's exactly what I mean. The ballooned m

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-07 Thread Michael S. Tsirkin
On Mon, Mar 07, 2016 at 06:49:19AM +, Li, Liang Z wrote: > > > No. And it's exactly what I mean. The ballooned memory is still > > > processed during live migration without skipping. The live migration code > > > is > > in migration/ram.c. > > > > So if guest acknowledged VIRTIO_BALLOON_F_MUS

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-06 Thread Li, Liang Z
> > No. And it's exactly what I mean. The ballooned memory is still > > processed during live migration without skipping. The live migration code is > in migration/ram.c. > > So if guest acknowledged VIRTIO_BALLOON_F_MUST_TELL_HOST, we can > teach qemu to skip these pages. > Want to write a patch

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-06 Thread Li, Liang Z
> > On 04/03/2016 15:26, Li, Liang Z wrote: > > >> > > > >> > The memory usage will keep increasing due to ever growing caches, > > >> > etc, so you'll be left with very little free memory fairly soon. > > >> > > > > I don't think so. > > > > > > > Roman is right. For example, here I am looking at

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-05 Thread Michael S. Tsirkin
On Fri, Mar 04, 2016 at 03:49:37PM +, Li, Liang Z wrote: > > > > > > > Only detect the unmapped/zero mapped pages is not enough. > > > > Consider > > > > > > the > > > > > > > situation like case 2, it can't achieve the same result. > > > > > > > > > > > > Your case 2 doesn't exist in the real

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > > > On 04/03/2016 15:26, Li, Liang Z wrote: > >> > > >> > The memory usage will keep increasing due to ever growing caches, etc, so > >> > you'll be left with very little free memory fairly soon. > >> > > > I don't think so. > > > > Roman is righ

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Paolo Bonzini
On 04/03/2016 15:26, Li, Liang Z wrote: >> > >> > The memory usage will keep increasing due to ever growing caches, etc, so >> > you'll be left with very little free memory fairly soon. >> > > I don't think so. > Roman is right. For example, here I am looking at a 64 GB (physical) machine wh

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> > > > > > Only detect the unmapped/zero mapped pages is not enough. > > > Consider > > > > > the > > > > > > situation like case 2, it can't achieve the same result. > > > > > > > > > > Your case 2 doesn't exist in the real world. If people could > > > > > stop their main memory consumer in the

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> > Maybe I am not clear enough. > > > > I mean if we inflate balloon before live migration, for a 8GB guest, it > > takes > about 5 Seconds for the inflating operation to finish. > > And these 5 seconds are spent where? > The time is spent on allocating the pages and send the allocated pages p

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Michael S. Tsirkin
On Fri, Mar 04, 2016 at 02:26:49PM +, Li, Liang Z wrote: > > Subject: Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration > > optimization > > > > On Fri, Mar 04, 2016 at 09:08:44AM +, Li, Liang Z wrote: > > > > On Fri, Mar 04, 2016 at

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> Subject: Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration > optimization > > On Fri, Mar 04, 2016 at 09:08:44AM +, Li, Liang Z wrote: > > > On Fri, Mar 04, 2016 at 01:52:53AM +, Li, Liang Z wrote: > > > > > I wonder if it would be

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Michael S. Tsirkin
On Fri, Mar 04, 2016 at 10:11:00AM +, Li, Liang Z wrote: > > On Fri, Mar 04, 2016 at 09:12:12AM +, Li, Liang Z wrote: > > > > Although I wonder which is cheaper; that would be fairly expensive > > > > for the guest wouldn't it? And you'd somehow have to kick the guest > > > > before migrati

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Roman Kagan
On Fri, Mar 04, 2016 at 09:08:44AM +, Li, Liang Z wrote: > > On Fri, Mar 04, 2016 at 01:52:53AM +, Li, Liang Z wrote: > > > > I wonder if it would be possible to avoid the kernel changes by > > > > parsing /proc/self/pagemap - if that can be used to detect > > > > unmapped/zero mapped pag

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> On Fri, Mar 04, 2016 at 09:12:12AM +, Li, Liang Z wrote: > > > Although I wonder which is cheaper; that would be fairly expensive > > > for the guest wouldn't it? And you'd somehow have to kick the guest > > > before migration to do the ballooning - and how long would you wait for > it to fin

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Michael S. Tsirkin
On Fri, Mar 04, 2016 at 09:12:12AM +, Li, Liang Z wrote: > > Although I wonder which is cheaper; that would be fairly expensive for the > > guest wouldn't it? And you'd somehow have to kick the guest before > > migration to do the ballooning - and how long would you wait for it to > > finish?

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Roman Kagan
On Fri, Mar 04, 2016 at 09:08:20AM +, Dr. David Alan Gilbert wrote: > * Roman Kagan (rka...@virtuozzo.com) wrote: > > On Fri, Mar 04, 2016 at 08:23:09AM +, Li, Liang Z wrote: > > > The unmapped/zero mapped pages can be detected by parsing > > > /proc/self/pagemap, > > > but the free pages

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> * Roman Kagan (rka...@virtuozzo.com) wrote: > > On Fri, Mar 04, 2016 at 08:23:09AM +, Li, Liang Z wrote: > > > > On Thu, Mar 03, 2016 at 05:46:15PM +, Dr. David Alan Gilbert wrote: > > > > > * Liang Li (liang.z...@intel.com) wrote: > > > > > > The current QEMU live migration implementatio

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> On Fri, Mar 04, 2016 at 01:52:53AM +, Li, Liang Z wrote: > > > I wonder if it would be possible to avoid the kernel changes by > > > parsing /proc/self/pagemap - if that can be used to detect > > > unmapped/zero mapped pages in the guest ram, would it achieve the > same result? > > > > Only

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Dr. David Alan Gilbert
* Roman Kagan (rka...@virtuozzo.com) wrote: > On Fri, Mar 04, 2016 at 08:23:09AM +, Li, Liang Z wrote: > > > On Thu, Mar 03, 2016 at 05:46:15PM +, Dr. David Alan Gilbert wrote: > > > > * Liang Li (liang.z...@intel.com) wrote: > > > > > The current QEMU live migration implementation mark the

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Roman Kagan
On Fri, Mar 04, 2016 at 08:23:09AM +, Li, Liang Z wrote: > > On Thu, Mar 03, 2016 at 05:46:15PM +, Dr. David Alan Gilbert wrote: > > > * Liang Li (liang.z...@intel.com) wrote: > > > > The current QEMU live migration implementation mark the all the > > > > guest's RAM pages as dirtied in the

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Li, Liang Z
> On Thu, Mar 03, 2016 at 05:46:15PM +, Dr. David Alan Gilbert wrote: > > * Liang Li (liang.z...@intel.com) wrote: > > > The current QEMU live migration implementation mark the all the > > > guest's RAM pages as dirtied in the ram bulk stage, all these pages > > > will be processed and that tak

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-04 Thread Roman Kagan
On Fri, Mar 04, 2016 at 01:52:53AM +, Li, Liang Z wrote: > > I wonder if it would be possible to avoid the kernel changes by parsing > > /proc/self/pagemap - if that can be used to detect unmapped/zero mapped > > pages in the guest ram, would it achieve the same result? > > Only detect the u

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-03 Thread Roman Kagan
On Thu, Mar 03, 2016 at 05:46:15PM +, Dr. David Alan Gilbert wrote: > * Liang Li (liang.z...@intel.com) wrote: > > The current QEMU live migration implementation mark the all the > > guest's RAM pages as dirtied in the ram bulk stage, all these pages > > will be processed and that takes quit a

RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-03 Thread Li, Liang Z
> On Thu, Mar 03, 2016 at 06:44:24PM +0800, Liang Li wrote: > > The current QEMU live migration implementation mark the all the > > guest's RAM pages as dirtied in the ram bulk stage, all these pages > > will be processed and that takes quit a lot of CPU cycles. > > > > From guest's point of view,

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-03 Thread Roman Kagan
On Thu, Mar 03, 2016 at 06:44:24PM +0800, Liang Li wrote: > The current QEMU live migration implementation mark the all the > guest's RAM pages as dirtied in the ram bulk stage, all these pages > will be processed and that takes quit a lot of CPU cycles. > > From guest's point of view, it doesn't