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

[Xen-devel] RE: [RFC][PATCH] Basic support for page offline

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: [Xen-devel] RE: [RFC][PATCH] Basic support for page offline
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Wed, 18 Feb 2009 22:51:21 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 18 Feb 2009 06:52:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090216143122.GD17060@xxxxxxxxxxxxxxxxxxxxx>
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: <E2263E4A5B2284449EEBD0AAB751098401C781605D@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20090213170341.GC17060@xxxxxxxxxxxxxxxxxxxxx> <E2263E4A5B2284449EEBD0AAB751098401C796A70E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20090216143122.GD17060@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmQQ0T9VcbB4WyHTmGlkuRXwmhkvABZ1Kjg
Thread-topic: [RFC][PATCH] Basic support for page offline
>-----Original Message-----
>From: Tim Deegan [mailto:Tim.Deegan@xxxxxxxxxx] 
>Sent: 2009年2月16日 22:31
>To: Jiang, Yunhong
>Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: Re: [RFC][PATCH] Basic support for page offline
>
>At 04:48 -0500 on 15 Feb (1234673293), Jiang, Yunhong wrote:
>> > The reference counting in update_pgtable_entry() is confusing -- it
>> > should probably always do reference counting for both the 
>old and new
>> > entries; that seems more robust than only doing the decrements
>> > there and
>> > manually setting count_info and type_info on the new page 
>in replace_page.
>> 
>> Sure, I will do like this.
>
>In fact, it should use the existing PTE-updating code -- I 
>suspect that,
>for example, your code won't work at all on a guest that has shadow
>pagetables enabled.

Can you please share me which existing PET-updating code? I browsed the code 
and didn't find approprate function, especially considering we need update all 
level page tables.

>
>> > The tools patch is enormous, and seems to copy big chunks of
>> > xc_domain_save into a new file.  And since Xen is now 
>doing the hard
>> > work of pagetable manipulation, I don't think you even 
>need to suspend
>> > the guest -- just pausing it should be enough and is much easier.
>> 
>> But I'm not sure if we can update the P2M table from Xen side, that's
>> the reason I did the it in the user space.
>
>In that case, why don't you update the pagetables from the tools as
>well?  That way you'd avoid walking the guest pagetables in Xen.  You
>could make all the PTE changes, try to free the page, and if it still
>doesn't work (because there's some other refcount held), put 
>things back
>the way they were.

Just as you stated before, there may have some corner case need considered, 
grant table etc (some is missed in my previous patch). For example, if guest 
has been granted, but the remote domain has not map it (i.e. it is in 
grant_table->shared, but not been mapped still), there should have no reference 
added, but if we don't hold the grant table lock, then the backend may mapped a 
wrong mfn. Such situation is difficult to be solved in tools. BTW, I suspect I 
may missed more reference count, for example, the page may be pinned etc, I 
will consider that in my next patch.

Also, as to your suggestion in previous mail of "since Xen is now doing the 
hard work of pagetable manipulation, I don't think you even need to suspend the 
guest -- just pausing it should be enough and is much easier", I suppose 
suspend guest will make thing much simpler. For example, we need consider the 
preempted hypercall that handle page table page (for example, the page table 
may be partially validated still when we do the offline).

Thanks
Yunhong Jiang

>
>Tim.
>
>-- 
>Tim Deegan <Tim.Deegan@xxxxxxxxxx>
>Principal Software Engineer, Citrix Systems (R&D) Ltd.
>[Company #02300071, SL9 0DZ, UK.]
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel