From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: RE: Re: [PATCH] Support swap a page from user spacetools -- Was RE: [RFC][PATCH] Basic support for page offline Date: Fri, 20 Mar 2009 09:37:58 +0000 Message-ID: <49C37206.76E4.0078.0@novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Yunhong Jiang Cc: Tim Deegan , "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> "Jiang, Yunhong" 20.03.09 03:52 >>> >The method to exchange the offline pending page for PV domain is: >1) Suspend the guest. >2) Allocate a new page for the guest >3) Get a copy for the content >4) User space tools will scan all page table page to see if any reference = to the offending page, if yes, then it will hypercall to Xen >to replace the entry to point to the new one. (Through the mmu_*ops) >5) After update all page tables, user space tools will try to exchange = the old page with the new page. If the new mfn has no >reference anymore (i.e. count_info & count_mask =3D 1), the exchange will = update the m2p and return success, otherwise it will >return fail. (the page may be referenced by other domain, like grant = table or foreign mapped). Hmm, if you consider the possibility of this case, then you should also = consider the possibility of a page still being accessible by another = domain at the point where you copy its content, but no longer in use when = you do the exchange (which means that the content may have changed between = the two points in time). >6) If step 5 is success, user space tools will update the content of the = new page and the p2m table, else it will try to undo step 4 >to revert page table changes. >7) Resume the guest. Jan