From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Yang Subject: Re: [RFC Design Doc]Speed up live migration by skipping free pages Date: Thu, 24 Mar 2016 09:24:24 +0800 Message-ID: <20160324012424.GB14956@linux-gk3p> References: <1458632629-4649-1-git-send-email-liang.z.li@intel.com> <20160322190530.GI2216@work-vm> Reply-To: Wei Yang Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: "rkagan@virtuozzo.com" , "linux-kernel@vger.kenel.org" , "ehabkost@redhat.com" , "kvm@vger.kernel.org" , "mst@redhat.com" , "simhan@hpe.com" , "quintela@redhat.com" , "Dr. David Alan Gilbert" , "qemu-devel@nongnu.org" , "jitendra.kolhe@hpe.com" , "mohan_parthasarathy@hpe.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "rth@twiddle.net" To: "Li, Liang Z" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Wed, Mar 23, 2016 at 06:48:22AM +0000, Li, Liang Z wrote: [...] >> > 8. Pseudo code >> > Dirty page logging should be enabled before getting the free page >> > information from guest, this is important because during the process >> > of getting free pages, some free pages may be used and written by the >> > guest, dirty page logging can trace these pages. The pseudo code=C2=A0= is >> > like below: >> > >> > ----------------------------------------------- >> > MigrationState *s =3D migrate_get_current(); >> > ... >> > >> > memory_global_dirty_log_start(); >> > >> > if (get_guest_mem_info(&info)) { >> > while (!get_free_page_bmap(free_page_bitmap, drop_page_cache) >> && >> > s->state !=3D MIGRATION_STATUS_CANCELLING) { >> > usleep(1000) // sleep for 1 ms >> > } >> > >> > tighten_free_page_bmap =3D >> tighten_guest_free_pages(free_page_bitmap); >> > filter_out_guest_free_pages(tighten_free_page_bmap); >> > } >>=20 >> Given the typical speed of networks; it wouldn't do too much harm to sta= rt >> sending assuming all pages are dirty and then when the guest finally gets >> around to finishing the bitmap then update, so it's asynchronous - and t= hen if >> the guest never responds we don't really care. > >Indeed, thanks! > This is interesting. By doing so, the threshold I mentioned in another mail= is not necessary, since we can do it in parallel. >Liang >>=20 >> Dave >>=20 >> > >> > migration_bitmap_sync(); >> > ... >> > >> > ----------------------------------------------- >> > >> > >> > -- >> > 1.9.1 >> > >> -- >> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK >N=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDr=EF=BF=BD=EF=BF=BDy=EF=BF= =BD=EF=BF=BD=EF=BF=BDb=EF=BF=BDX=EF=BF=BD=EF=BF=BD=C7=A7v=EF=BF=BD^=EF=BF= =BD)=DE=BA{.n=EF=BF=BD+=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDh=EF=BF=BD=EF=BF= =BD=17=EF=BF=BD=EF=BF=BD=DC=A8}=EF=BF=BD=EF=BF=BD=EF=BF=BD=C6=A0z=EF=BF=BD&= j:+v=EF=BF=BD=EF=BF=BD=EF=BF=BD=07=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDzZ+= =EF=BF=BD=EF=BF=BD+zf=EF=BF=BD=EF=BF=BD=EF=BF=BDh=EF=BF=BD=EF=BF=BD=EF=BF= =BD~=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDi=EF=BF=BD=EF=BF=BD=EF=BF=BDz=EF=BF= =BD=1E=EF=BF=BDw=EF=BF=BD=EF=BF=BD=EF=BF=BD?=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF= =BF=BD&=EF=BF=BD)=DF=A2=1Bf --=20 Richard Yang\nHelp you, Help me