From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiu2U-0000u4-7G for qemu-devel@nongnu.org; Wed, 23 Mar 2016 21:26:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiu2P-0004M8-3I for qemu-devel@nongnu.org; Wed, 23 Mar 2016 21:26:18 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:4456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiu2O-0004Lr-8z for qemu-devel@nongnu.org; Wed, 23 Mar 2016 21:26:13 -0400 Date: Thu, 24 Mar 2016 09:24:24 +0800 From: Wei Yang Message-ID: <20160324012424.GB14956@linux-gk3p> References: <1458632629-4649-1-git-send-email-liang.z.li@intel.com> <20160322190530.GI2216@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Subject: Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages Reply-To: Wei Yang List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Li, Liang Z" 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" 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