linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] KVM: MMU: remove unnecessary remote tlb flush
@ 2010-06-08 12:05 Xiao Guangrong
  2010-06-08 12:05 ` [PATCH 2/3] KVM: MMU: using wrapper function to flush local tlb Xiao Guangrong
  2010-06-08 12:07 ` [PATCH 3/3] KVM: MMU: delay local tlb flush Xiao Guangrong
  0 siblings, 2 replies; 4+ messages in thread
From: Xiao Guangrong @ 2010-06-08 12:05 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM list

This remote tlb flush is no necessary since we have synced while
sp is zapped

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 arch/x86/kvm/mmu.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 6b2c644..959c248 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3038,8 +3038,6 @@ restart:
 
 	kvm_mmu_commit_zap_page(kvm, &invalid_list);
 	spin_unlock(&kvm->mmu_lock);
-
-	kvm_flush_remote_tlbs(kvm);
 }
 
 static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm,
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] KVM: MMU: using wrapper function to flush local tlb
  2010-06-08 12:05 [PATCH 1/3] KVM: MMU: remove unnecessary remote tlb flush Xiao Guangrong
@ 2010-06-08 12:05 ` Xiao Guangrong
  2010-06-08 12:07 ` [PATCH 3/3] KVM: MMU: delay local tlb flush Xiao Guangrong
  1 sibling, 0 replies; 4+ messages in thread
From: Xiao Guangrong @ 2010-06-08 12:05 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM list

Using kvm_mmu_flush_tlb() function instead of calling
kvm_x86_ops->tlb_flush(vcpu) directly

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 arch/x86/kvm/mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 959c248..7319098 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1982,7 +1982,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
 		      reset_host_protection)) {
 		if (write_fault)
 			*ptwrite = 1;
-		kvm_x86_ops->tlb_flush(vcpu);
+		kvm_mmu_flush_tlb(vcpu);
 	}
 
 	pgprintk("%s: setting spte %llx\n", __func__, *sptep);
-- 
1.6.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] KVM: MMU: delay local tlb flush
  2010-06-08 12:05 [PATCH 1/3] KVM: MMU: remove unnecessary remote tlb flush Xiao Guangrong
  2010-06-08 12:05 ` [PATCH 2/3] KVM: MMU: using wrapper function to flush local tlb Xiao Guangrong
@ 2010-06-08 12:07 ` Xiao Guangrong
  2010-06-09 12:06   ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Xiao Guangrong @ 2010-06-08 12:07 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM list

delay local tlb flush until enter guest moden, it can reduce vpid flush
frequency and reduce remote tlb flush IPI(if KVM_REQ_TLB_FLUSH bit is
already set, IPI is not sent)

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 arch/x86/kvm/mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 7319098..75ddaa1 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2362,7 +2362,7 @@ static int nonpaging_init_context(struct kvm_vcpu *vcpu)
 void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu)
 {
 	++vcpu->stat.tlb_flush;
-	kvm_x86_ops->tlb_flush(vcpu);
+	set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests);
 }
 
 static void paging_new_cr3(struct kvm_vcpu *vcpu)
-- 
1.6.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] KVM: MMU: delay local tlb flush
  2010-06-08 12:07 ` [PATCH 3/3] KVM: MMU: delay local tlb flush Xiao Guangrong
@ 2010-06-09 12:06   ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2010-06-09 12:06 UTC (permalink / raw)
  To: Xiao Guangrong; +Cc: Marcelo Tosatti, LKML, KVM list

On 06/08/2010 03:07 PM, Xiao Guangrong wrote:
> delay local tlb flush until enter guest moden, it can reduce vpid flush
> frequency and reduce remote tlb flush IPI(if KVM_REQ_TLB_FLUSH bit is
> already set, IPI is not sent)
>    

Applied all, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-09 12:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-08 12:05 [PATCH 1/3] KVM: MMU: remove unnecessary remote tlb flush Xiao Guangrong
2010-06-08 12:05 ` [PATCH 2/3] KVM: MMU: using wrapper function to flush local tlb Xiao Guangrong
2010-06-08 12:07 ` [PATCH 3/3] KVM: MMU: delay local tlb flush Xiao Guangrong
2010-06-09 12:06   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).