From: Tim Deegan Subject: Re: Shadow Page Tables in Xen Date: Tue, 21 Apr 2009 12:45:49 +0100 Message-ID: <20090421114549.GF10010@york.uk.xensource.com> References: <46562.49315.qm@web8405.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <46562.49315.qm@web8405.mail.in.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: priya sehgal Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi,=20 At 12:37 +0100 on 21 Apr (1240317466), priya sehgal wrote: > We have a course project, in which we have to improve the performance > of live migration for HVM guests. It seems that to support live > migration, all the page table entries in the shadow page table are > marked as write protected, so as to know which pages are dirtied and > to be sent to the other machine. Since, there will be many page faults > leading to performance degradation, we want to reduce these page > faults. In our course project, we are supposed to form groups of pages > and if any page in the group hits the page fault (due to > write-protection), we mark all the pages in the group as RW. This way > we can reduce the page faults. I see. Yes, in the shadow pagetables that should be easy enough; the shadow_set_l1e() function is where the read-only mapping will be replaced by a read-write one, which should be a hint that you might want to reconsider its neighbours. > This is based on some hueristic that if a page is written, its > immediate neighbors will also be written. I'd be interested to hear how it trades off against increaded bandwicth use.=20 Cheers, Tim. > My concern was that since we will be touching the same shadow page > table and marking its PTEs as RO or RW during different epochs we > should not break something existing. >=20 > Priya.I=20 > --- On Tue, 4/21/09, Tim Deegan wrote: >=20 > > From: Tim Deegan > > Subject: Re: [Xen-devel] Shadow Page Tables in Xen > > To: "priya sehgal" > > Cc: "xen-devel@lists.xensource.com" > > Date: Tuesday, April 21, 2009, 2:07 PM > > Hi,=20 > >=20 > > At 20:34 +0100 on 20 Apr (1240259658), priya sehgal wrote: > > > I was going through the memory management in Xen and > > little confused > > > about shadow page tables for HVM guest and how they > > work. > >=20 > > Why are you interested?=A0 Do you have a project in > > mind?=20 > >=20 > > > Few of my questions are : > > > 1. A shadow page table, is a copy of the guest page > > table, with actual machine frame numbers (MFN), as against > > the physical page number(PFN) in case of guests.=20 > > > Do the shadow page tables write protect each of the > > PTE it contains, or only the pages containing the "guest > > page table" are write protected (to check if the guest has > > modified any entry)?=20 > >=20 > > They write-protect all pagetables and some other things but > > not all of > > memory; that wouldn't be very useful. > >=20 > > > 2. I know that live migration is supported on xen, but > > not sure if it works for HVM guests. In this case also, xen > > will need to keep a shadow page table, which should detect > > which pages have been modified since the last time the pages > > were migrated. For this, shadow page table should mark all > > the PTEs as write protected. Does xen implement live > > migration of HVM guests in this way ?=20 > > > If yes, then is this shadow table same as the one used > > in (1), or there are multiple copies of the shadow tables > > for different purposes? > >=20 > > There's only one set of shadows, since the MMU can only use > > one at a > > time.=20 > >=20 > > Cheers, > >=20 > > Tim. > >=20 > > > Thanks. > > > Priya > > >=20 > > >=20 > > >=A0 =A0 =A0=A0=A0 > > >=20 > > > _______________________________________________ > > > Xen-devel mailing list > > > Xen-devel@lists.xensource.com > > > http://lists.xensource.com/xen-devel > >=20 > > --=20 > > Tim Deegan > > Principal Software Engineer, Citrix Systems (R&D) Ltd. > > [Company #02300071, SL9 0DZ, UK.] > >=20 >=20 >=20 > =20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --=20 Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]