lkml.org 
[lkml]   [2010]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] KVM: MMU: don't walk every parent pages while mark unsync
On Tue, Jun 15, 2010 at 09:32:25AM +0800, Xiao Guangrong wrote:
>
>
> Marcelo Tosatti wrote:
>
> >> - if (!sp->multimapped) {
> >> - kvm_mmu_update_unsync_bitmap(sp->parent_pte);
> >> + if (sp->unsync_children++)
> >> return;
> >
> > This looks wrong. If the sp has an unrelated children marked as
> > unsync (which increased sp->unsync_children), you stop the walk?
> >
>
> Marcelo,
>
> I think it's right :-), we only walk the parents only when
> sp->unsync_children is 0, since sp->unsync_children is the number bit
> set in sp->unsync_child_bitmap, if sp->unsync_children > 0, we can sure
> its parents already have mark unsync-child-exist, assume, for example,
> have this mapping:
>
> / SP1
> P1 -> P2
> \ SP2
>
> [ P2 = P1.pte[0] SP1 = P2.pte[0] SP2 = P2.pte[1] ]
>
> First, we mark SP1 unsyc, it will set:
> P2.unsync_child_bitmap[0] = 1, P2.unsync_children = 1
> and
> P1.unsync_child_bitmap[0] = 1, P1.unsync_children = 1
>
> Then, we mark SP2 unsync, we only need do:
> P2.unsync_child_bitmap[1] = 1, P2.unsync_children = 2
> no need touch P1, since the P1 is already mark pte[0] unsync-child-exist.


You're right. Applied.



\
 
 \ /
  Last update: 2010-06-16 01:51    [W:2.964 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site