>-----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
|