Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-30 Thread David S. Ahern
Marcelo Tosatti wrote: > On Tue, Oct 28, 2008 at 12:36:14PM -0600, David S. Ahern wrote: >>> That is, the fact that KVM does not handle unsynced TSC's on the host is >>> not an argument against this patch which clearly fixes a bug. >>> >>> Take commit 019960ae9933161c2809fa4ee608ba30d9639fd2 for

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-30 Thread Avi Kivity
David S. Ahern wrote: Has anything changed "recently" with the TSC code? Recently here being the past 2 months since you first crafted the patch. I ask because in the past few runs based on kvm.git trees (e.g., as recently as a pull on 10/26), this tsc offset patch no longer fixes the problem. T

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-30 Thread Marcelo Tosatti
On Tue, Oct 28, 2008 at 12:36:14PM -0600, David S. Ahern wrote: > > > That is, the fact that KVM does not handle unsynced TSC's on the host is > > not an argument against this patch which clearly fixes a bug. > > > > Take commit 019960ae9933161c2809fa4ee608ba30d9639fd2 for example. > > > > Has

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-28 Thread David S. Ahern
Marcelo Tosatti wrote: > On Sat, Sep 13, 2008 at 07:55:02AM +0300, Avi Kivity wrote: >> Marcelo Tosatti wrote: >>> VMX initializes the TSC offset for each vcpu at different times, and >>> also reinitializes it for vcpus other than 0 on APIC SIPI message. >>> >>> This bug causes the TSC's to appea

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-27 Thread Marcelo Tosatti
On Sat, Sep 13, 2008 at 07:55:02AM +0300, Avi Kivity wrote: > Marcelo Tosatti wrote: > > VMX initializes the TSC offset for each vcpu at different times, and > > also reinitializes it for vcpus other than 0 on APIC SIPI message. > > > > This bug causes the TSC's to appear unsynchronized in the gues

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-10-13 Thread David S. Ahern
Marcelo: Do you have a similar patch/idea for AMD? Same program as before. Sets affinity to run on vcpu 0, call gettimeofday(). Repeat for vcpu 1. ... Repeat for vcpu max. sleep(1). Repeat sequence. So in the following example output the process calls sleep with affinity set to vcpu3, and on wak

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-09-12 Thread Avi Kivity
Marcelo Tosatti wrote: > VMX initializes the TSC offset for each vcpu at different times, and > also reinitializes it for vcpus other than 0 on APIC SIPI message. > > This bug causes the TSC's to appear unsynchronized in the guest, even if > the host is good. > > Older Linux kernels don't handle th

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-09-11 Thread Marcelo Tosatti
On Wed, Sep 10, 2008 at 07:18:43PM -0300, Glauber Costa wrote: > On Wed, Sep 10, 2008 at 05:58:42PM -0300, Marcelo Tosatti wrote: > > > > VMX initializes the TSC offset for each vcpu at different times, and > > also reinitializes it for vcpus other than 0 on APIC SIPI message. > > > > This bug ca

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-09-10 Thread David S. Ahern
Hi Marcelo: Dramatic improvement. The following is an example with kvm-75 and this patch. Without cpu affinity from a kvm perspective (vcpu-to-pcpu): cpu 0: 1221107886.020298 cpu 1: 1221107886.020290 * cpu 2: 1221107886.020555 cpu 3: 1221107886.020549 * cpu 0: 1221107887.030244 cpu 1: 122110788

Re: RFC: VMX: initialize TSC offset relative to vm creation time

2008-09-10 Thread Glauber Costa
On Wed, Sep 10, 2008 at 05:58:42PM -0300, Marcelo Tosatti wrote: > > VMX initializes the TSC offset for each vcpu at different times, and > also reinitializes it for vcpus other than 0 on APIC SIPI message. > > This bug causes the TSC's to appear unsynchronized in the guest, even if > the host is

RFC: VMX: initialize TSC offset relative to vm creation time

2008-09-10 Thread Marcelo Tosatti
VMX initializes the TSC offset for each vcpu at different times, and also reinitializes it for vcpus other than 0 on APIC SIPI message. This bug causes the TSC's to appear unsynchronized in the guest, even if the host is good. Older Linux kernels don't handle the situation very well, so gettimeo