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][PATCH]Provide 3 times continously writes check andunshad

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>, "Xin, Xiaohui" <xiaohui.xin@xxxxxxxxx>
Subject: RE: [Xen-devel][PATCH]Provide 3 times continously writes check andunshadow the guest page
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Thu, 31 Jan 2008 15:14:06 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 30 Jan 2008 23:17:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080128094858.GA23373@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <9A1462408D6D394C8A7A812E98F00A4D02823CA4@xxxxxxxxxxxxxxxxxxxxxxxxxxxx><20080123095146.GA16276@xxxxxxxxxxxxxxxxxxxxx><9A1462408D6D394C8A7A812E98F00A4D02823FD2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx><20080124094921.GA5512@xxxxxxxxxxxxxxxxxxxxx> <20080128094858.GA23373@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Achhk6CsVxYEwCH6THyWkekFMAVi3gCN+UaA
Thread-topic: [Xen-devel][PATCH]Provide 3 times continously writes check andunshadow the guest page
>From: Tim Deegan
>Sent: 2008年1月28日 17:49
>
>Hi,
>
>At 09:49 +0000 on 24 Jan (1201168161), Tim Deegan wrote:
>> The measurements you gave look like it fixes
>> one particularly bad case very well, but makes overall performance
>> worse.  In that case, I'm wondering whether there might be a 
>better way
>> of fixing the network-buffer issue without degrading general
>> performance.
>
>What's the trade-off if you use numbers other than three in this
>heuristic?  Does a higher number still detetct data pages without
>harming the general performance so much?
>
>Cheers,
>
>Tim.
>

I noted that existing early unshadow heuristic has one exception
on top level page table. I guess the reason is to avoid incorrect
unshadow on top level which implicates whole address space
being unshadowed with heavy overhead to be re-shadowed later.
Also if top level page table is pointed by current guest CR3, it's
sure not an indicator for unshadow.

But now I'm considering whether we can release that check on
top level page table if it's not pinned by current guest CR3. Take
Xiaohui's iperf case for example, she found incorrectly shadowed
pages are mostly L2 pages on 32 and 32pae. So the point is 
whether OS may update top level page tables continuously like 
by 2 continuous zero writes or 3 continuous writes:

    * At fork, parent mappings are modified to RO, but normally
on leaf entry. Child page table is not active yet at mm clone

    * At exit, normally user VMAs are free-ed one by one and top
level page is unlikey to be seen continuous writes. After user
VMAs are free-ed, it's easy to free whole pgd directly without 
further touch. That's one corner case Xiaohui's patch tries to 
solve when it's used later as data page.

    * OS may also put some special pattern in batch style
like from swap thread. But reasonably those patterns are put
in leaf entries, and continuous touch on top level is less likely.

Please correct me since definitely I may miss important OS
behaviors. If above assumption is true, we may use a heuristic
combo on top of Xiaohui's patch:
    <3 continuous writes on INACTIVE top level page table>

I guess thrash results in Xiaohui's test results may come from
such heuristics applied to leaf pages also which is too aggre-
sive in same cases. But for top level pages, we may be able
to catch up one heuristics then... :-)

Thanks,
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel