public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: pinning, tsc and apic
Date: Wed, 14 May 2008 23:59:39 -0700	[thread overview]
Message-ID: <20080515065912.GE4017@sequoia.sous-sol.org> (raw)
In-Reply-To: <482B7983.1030000@codemonkey.ws>

* Anthony Liguori (anthony@codemonkey.ws) wrote:
>  From a quick look, I suspect that the number of wildly off TSC 
> calibrations correspond to the VMs that are misbehaving.  I think this 
> may mean that we have to re-examine the tsc delta computation.
> 
> 10_serial.log:time.c: Detected 1995.038 MHz processor.
> 11_serial.log:time.c: Detected 2363.195 MHz processor.
> 12_serial.log:time.c: Detected 2492.675 MHz processor.
> 13_serial.log:time.c: Detected 1995.061 MHz processor.
> 14_serial.log:time.c: Detected 1994.917 MHz processor.
> 15_serial.log:time.c: Detected 4100.735 MHz processor.
> 16_serial.log:time.c: Detected 2075.800 MHz processor.
> 17_serial.log:time.c: Detected 2674.350 MHz processor.
> 18_serial.log:time.c: Detected 1995.002 MHz processor.
> 19_serial.log:time.c: Detected 1994.978 MHz processor.
> 1_serial.log:time.c: Detected 4384.310 MHz processor.

Is this with pinning?  We at least know we're losing small bits on
migration.  From my measurements it's ~3000 (outliers are 10-20k).

Also, what happens if you roll back to kvm-userspace 7f5c4d15ece5?

I'm using this:

diff -up arch/x86/kvm/svm.c~svm arch/x86/kvm/svm.c
--- arch/x86/kvm/svm.c~svm	2008-04-16 19:49:44.000000000 -0700
+++ arch/x86/kvm/svm.c	2008-05-14 23:44:18.000000000 -0700
@@ -621,6 +621,13 @@ static void svm_free_vcpu(struct kvm_vcp
 	kmem_cache_free(kvm_vcpu_cache, svm);
 }
 
+static void svm_tsc_update(void *arg)
+{
+	struct vcpu_svm *svm = arg;
+	rdtscll(svm->vcpu.arch.host_tsc);
+
+}
+
 static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
@@ -633,6 +640,9 @@ static void svm_vcpu_load(struct kvm_vcp
 		 * Make sure that the guest sees a monotonically
 		 * increasing TSC.
 		 */
+		if (vcpu->cpu != -1)
+			smp_call_function_single(vcpu->cpu, svm_tsc_update,
+						 svm, 0, 1);
 		rdtscll(tsc_this);
 		delta = vcpu->arch.host_tsc - tsc_this;
 		svm->vmcb->control.tsc_offset += delta;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-05-15  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 19:19 pinning, tsc and apic Ryan Harper
2008-05-12 19:49 ` Anthony Liguori
2008-05-12 21:23   ` Ryan Harper
2008-05-12 21:44     ` Anthony Liguori
2008-05-13 18:56       ` Ryan Harper
2008-05-14 23:25 ` Marcelo Tosatti
2008-05-14 23:45   ` Anthony Liguori
2008-05-15  6:59     ` Chris Wright [this message]
2008-05-15 14:10       ` Anthony Liguori
2008-05-15 16:26       ` Ryan Harper
2008-06-18 13:12       ` [kvm-devel] " Avi Kivity

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=20080515065912.GE4017@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=anthony@codemonkey.ws \
    --cc=kvm-devel@lists.sourceforge.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox