Re: [Qemu-devel] RFC migration of zero pages

2013-02-02 Thread Peter Lieven
Am 01.02.2013 18:03, schrieb Paolo Bonzini: > Il 31/01/2013 09:33, Orit Wasserman ha scritto: If my above assumption that the guest reads unmapped memory as zeroes is right, this mapping is not necessary in the case of a zero dup page. We just have to make sure that we are

Re: [Qemu-devel] RFC migration of zero pages

2013-02-02 Thread Paolo Bonzini
Il 31/01/2013 09:33, Orit Wasserman ha scritto: >> > If my above assumption that the guest reads unmapped memory as zeroes is >> > right, this mapping >> > is not necessary in the case of a zero dup page. >> > >> > We just have to make sure that we are still in the very first round when >> > dec

Re: [Qemu-devel] RFC migration of zero pages

2013-02-01 Thread Paolo Bonzini
Il 31/01/2013 10:48, Gleb Natapov ha scritto: >> Also I notice that the bottle neck in migrating unmapped pages is the >> detection of those pages >> because we map the pages in order to check them, for a large guest this is >> very expensive as mapping a page >> results in a page fault in the ho

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Avi Kivity
On Jan 31, 2013 11:14 PM, "Michael S. Tsirkin" wrote: > > On Thu, Jan 31, 2013 at 05:20:02PM +0200, Avi Kivity wrote: > > On Thu, Jan 31, 2013 at 4:42 PM, Gleb Natapov wrote: > > > On Thu, Jan 31, 2013 at 04:36:25PM +0200, Avi Kivity wrote: > > >> On Thu, Jan 31, 2013 at 4:30 PM, Gleb Natapov wr

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Michael S. Tsirkin
On Thu, Jan 31, 2013 at 05:20:02PM +0200, Avi Kivity wrote: > On Thu, Jan 31, 2013 at 4:42 PM, Gleb Natapov wrote: > > On Thu, Jan 31, 2013 at 04:36:25PM +0200, Avi Kivity wrote: > >> On Thu, Jan 31, 2013 at 4:30 PM, Gleb Natapov wrote: > >> >> > > >> >> > Avi/Michael do you remember why mincore

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Avi Kivity
On Jan 31, 2013 12:29 PM, "Orit Wasserman" wrote: > > On 01/31/2013 11:48 AM, Gleb Natapov wrote: > > On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: > >> On 01/31/2013 08:57 AM, Peter Lieven wrote: > >>> Hi, > >>> > >>> I just came across an idea and would like to have feedback if

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Avi Kivity
On Thu, Jan 31, 2013 at 4:42 PM, Gleb Natapov wrote: > On Thu, Jan 31, 2013 at 04:36:25PM +0200, Avi Kivity wrote: >> On Thu, Jan 31, 2013 at 4:30 PM, Gleb Natapov wrote: >> >> > >> >> > Avi/Michael do you remember why mincore can't be used to check if a >> >> > guest >> >> page is unmapped? >>

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Avi Kivity
On Jan 31, 2013 4:03 PM, "Peter Lieven" wrote: > > > Am 31.01.2013 um 14:59 schrieb Avi Kivity : > >> >> On Jan 31, 2013 12:29 PM, "Orit Wasserman" wrote: >> > >> > On 01/31/2013 11:48 AM, Gleb Natapov wrote: >> > > On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: >> > >> On 01/31/

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Avi Kivity
On Thu, Jan 31, 2013 at 4:30 PM, Gleb Natapov wrote: >> > >> > Avi/Michael do you remember why mincore can't be used to check if a guest >> page is unmapped? >> >> A page may be not in core, but also nonzero (for example swap). > Yes, mincore() should not be used as zero page check, but it can be

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Michael R. hines
What about using the linux pagemap? With RDMA, I have exactly this problem. The cost of mapping and faulting and checking for zeros is higher than the cost of simply dumping the page into remote memory on the server side. If we could avoid accessing the page, it was save huge amounts of time.

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Gleb Natapov
On Thu, Jan 31, 2013 at 04:36:25PM +0200, Avi Kivity wrote: > On Thu, Jan 31, 2013 at 4:30 PM, Gleb Natapov wrote: > >> > > >> > Avi/Michael do you remember why mincore can't be used to check if a guest > >> page is unmapped? > >> > >> A page may be not in core, but also nonzero (for example swap)

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Gleb Natapov
On Thu, Jan 31, 2013 at 03:59:23PM +0200, Avi Kivity wrote: > On Jan 31, 2013 12:29 PM, "Orit Wasserman" wrote: > > > > On 01/31/2013 11:48 AM, Gleb Natapov wrote: > > > On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: > > >> On 01/31/2013 08:57 AM, Peter Lieven wrote: > > >>> Hi, >

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Peter Lieven
Am 31.01.2013 um 14:59 schrieb Avi Kivity : > > On Jan 31, 2013 12:29 PM, "Orit Wasserman" wrote: > > > > On 01/31/2013 11:48 AM, Gleb Natapov wrote: > > > On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: > > >> On 01/31/2013 08:57 AM, Peter Lieven wrote: > > >>> Hi, > > >>> > >

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Peter Lieven
RFC patch is attached. Comments appreciated. I have two concerns left: a) what happens if a page turns from zero to non-zero in the first stage. Is this page transferred in the same round or in the next? b) what happens if live migration fails or is aborted and then again a migration is started to

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Orit Wasserman
On 01/31/2013 11:48 AM, Gleb Natapov wrote: > On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: >> On 01/31/2013 08:57 AM, Peter Lieven wrote: >>> Hi, >>> >>> I just came across an idea and would like to have feedback if it makes >>> sence or not. >>> >>> If a VM is started without p

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Gleb Natapov
On Thu, Jan 31, 2013 at 09:47:24AM +0200, Orit Wasserman wrote: > On 01/31/2013 08:57 AM, Peter Lieven wrote: > > Hi, > > > > I just came across an idea and would like to have feedback if it makes > > sence or not. > > > > If a VM is started without preallocated memory all memory that has not be

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Orit Wasserman
On 01/31/2013 10:10 AM, Peter Lieven wrote: > > Am 31.01.2013 um 08:47 schrieb Orit Wasserman : > >> On 01/31/2013 08:57 AM, Peter Lieven wrote: >>> Hi, >>> >>> I just came across an idea and would like to have feedback if it makes >>> sence or not. >>> >>> If a VM is started without preallocate

Re: [Qemu-devel] RFC migration of zero pages

2013-01-31 Thread Peter Lieven
Am 31.01.2013 um 08:47 schrieb Orit Wasserman : > On 01/31/2013 08:57 AM, Peter Lieven wrote: >> Hi, >> >> I just came across an idea and would like to have feedback if it makes sence >> or not. >> >> If a VM is started without preallocated memory all memory that has not been >> written to >>

Re: [Qemu-devel] RFC migration of zero pages

2013-01-30 Thread Orit Wasserman
On 01/31/2013 08:57 AM, Peter Lieven wrote: > Hi, > > I just came across an idea and would like to have feedback if it makes sence > or not. > > If a VM is started without preallocated memory all memory that has not been > written to > reads as zeros, right? Hi, No the memory will be unmapped (

[Qemu-devel] RFC migration of zero pages

2013-01-30 Thread Peter Lieven
Hi, I just came across an idea and would like to have feedback if it makes sence or not. If a VM is started without preallocated memory all memory that has not been written to reads as zeros, right? If a VM with a lot of unwritten memory is migrated or if the memory contains a lot of zeroed o