On Friday 02 November 2007 10:14:35 Haydn Solomon wrote:
> On Nov 1, 2007 9:54 PM, Haydn Solomon <[EMAIL PROTECTED]> wrote:
> > On Nov 1, 2007 9:36 PM, Sheng Yang <[EMAIL PROTECTED]> wrote:
> > > On Friday 02 November 2007 09:10:31 Haydn Solomon wrote:
> > > > How can I tell that my cpu has flexpriority?
> > > >
> > > > (Resending this as didn't cc list last time.)
> > >
> > > Oops, forgot the patch...
> >
> > Thanks Sheng.
> >
> > Luckily for me I've got the Flexpriority feature
> >
> > [EMAIL PROTECTED] winxptest]# dmesg | grep lex
> > kvm: FlexPriority enabled!
> >
> > One thing I do notice apart from noticeably very good responsiveness and
> > performance on windows guest ( xp sp2 ) is that this is the lowest cpu
> > usage I've seen on the qemu kvm process to date. I haven't tried smp yet
> > but that will be my next test and will report on how that goes. Thanks
> > guys and well done!
>
> One issue I do see. When I run my windows xp guest which is ACPI
> Multiprocessor PC HAL with -smp 2, it runs much slower and cpu usage is
> high.

Please try the attach patch. 

-- 
Thanks
Yang, Sheng
From 8009718459efe41e0e8bc943a62734353c7828a2 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[EMAIL PROTECTED]>
Date: Fri, 2 Nov 2007 11:15:15 +0800
Subject: [PATCH] KVM: VMX: Fix repeatly allocate of apic access page

For SMP guest, alloc_apic_access_page() would be called more than once.
So only the last one works, causing SMP guest can't benifit from FlexPriority.

This patch fixed this issue.

Signed-off-by: Sheng Yang <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |    1 +
 drivers/kvm/vmx.c      |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 34a681d..519626d 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -245,6 +245,7 @@ static struct kvm *kvm_create_vm(void)
 	spin_lock(&kvm_lock);
 	list_add(&kvm->vm_list, &vm_list);
 	spin_unlock(&kvm_lock);
+	kvm->apic_access_page = NULL;
 	return kvm;
 }
 
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 42e7fad..de4441a 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1466,6 +1466,8 @@ static int alloc_apic_access_page(struct kvm *kvm)
 	int r;
 
 	r = -EFAULT;
+	if (kvm->apic_access_page)
+		return 0;
 	kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;
 	kvm_userspace_mem.flags = 0;
 	kvm_userspace_mem.guest_phys_addr = 0xfee00000ULL;
-- 
1.5.2

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to