WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] Re: [PATCH] Support swap a page from user spacetools --

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: RE: [Xen-devel] Re: [PATCH] Support swap a page from user spacetools -- Was RE: [RFC][PATCH] Basic support for page offline
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Fri, 20 Mar 2009 17:41:40 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Fri, 20 Mar 2009 02:43:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49C37206.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E2263E4A5B2284449EEBD0AAB751098401C7EC072A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C5E8270F.48DA%keir.fraser@xxxxxxxxxxxxx> <E2263E4A5B2284449EEBD0AAB751098401CE2D1007@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <49C37206.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmpP3PIulQu+VVQS+WDLiDtPf/i0wAAENEA
Thread-topic: [Xen-devel] Re: [PATCH] Support swap a page from user spacetools -- Was RE: [RFC][PATCH] Basic support for page offline
Jan Beulich <mailto:jbeulich@xxxxxxxxxx> wrote:
>>>> "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> 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 = 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).

Aha, yes, thanks for pointing this. I considerd this but apparently missed this 
race condition. 
When the page is freed, we can't map the page from the user space anymore, so 
we have to do it in the exchange hypercall to gurantee the atomic.

Keir, I checked the  XENMEM_exchange before, and it didn't do the copy, are 
there any reason for that? Or if we can add the copy to it?

Thanks
Yunhong Jiang

> 
>> 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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>