All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>, KVM <kvm@vger.kernel.org>
Subject: Re: [PATCH v2] KVM: MMU: optimize pte write path if don't have protected sp
Date: Wed, 11 May 2011 20:01:31 +0800	[thread overview]
Message-ID: <4DCA7A9B.6060305@cn.fujitsu.com> (raw)
In-Reply-To: <4DCA72C3.6050300@redhat.com>

On 05/11/2011 07:28 PM, Avi Kivity wrote:
> On 05/11/2011 05:44 AM, Xiao Guangrong wrote:
>> Simply return from kvm_mmu_pte_write path if no shadow page is
>> write-protected, then we can avoid to walk all shadow pages and hold
>> mmu-lock
>>
>> @@ -1038,8 +1038,10 @@ static void kvm_mmu_free_page(struct kvm *kvm, struct kvm_mmu_page *sp)
>>       hlist_del(&sp->hash_link);
>>       list_del(&sp->link);
>>       free_page((unsigned long)sp->spt);
>> -    if (!sp->role.direct)
>> +    if (!sp->role.direct) {
>>           free_page((unsigned long)sp->gfns);
>> +        atomic_dec(&kvm->arch.indirect_shadow_pages);
>> +    }
>>       kmem_cache_free(mmu_page_header_cache, sp);
>>       kvm_mod_used_mmu_pages(kvm, -1);
>>   }
>> @@ -1536,6 +1538,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
>>               kvm_sync_pages(vcpu, gfn);
>>
>>           account_shadowed(vcpu->kvm, gfn);
>> +        atomic_inc(&vcpu->kvm->arch.indirect_shadow_pages);
>>       }
> 
> Better in account_shadowed()/unaccount_shadowed(), no?
> 

Yes, will fix. thanks for your reminder!


      reply	other threads:[~2011-05-11 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  2:44 [PATCH v2] KVM: MMU: optimize pte write path if don't have protected sp Xiao Guangrong
2011-05-11 11:28 ` Avi Kivity
2011-05-11 12:01   ` Xiao Guangrong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCA7A9B.6060305@cn.fujitsu.com \
    --to=xiaoguangrong@cn.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.