Re: TSC calibration in virtual machines

2018-06-27 Thread Ian Lepore
On Wed, 2018-06-27 at 10:05 -0700, Rodney W. Grimes wrote: > > > > On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim > > wrote: > > > > > > > > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > > > > > > > > > I

Re: TSC calibration in virtual machines

2018-06-27 Thread Stephen J. Kiernan
On Wed, Jun 27, 2018, 12:48 PM Alan Somers wrote: > On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim wrote: > > > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > > > It seems that TSC calibration in virtual machines sometimes can do more > > harm > > &

Re: TSC calibration in virtual machines

2018-06-27 Thread Jung-uk Kim
On 06/27/2018 13:05, Rodney W. Grimes wrote: > There are several white papers, including one from VMWare about what > they have done to help with the time keeping problems. https://www.vmware.com/files/pdf/techpaper/Timekeeping-In-VirtualMachines.pdf Jung-uk Kim signature.asc Description: Open

Re: TSC calibration in virtual machines

2018-06-27 Thread Rodney W. Grimes
> On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim wrote: > > > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > > > It seems that TSC calibration in virtual machines sometimes can do more > > harm > > > than good. Should we default to trusting

Re: TSC calibration in virtual machines

2018-06-27 Thread Jung-uk Kim
On 06/27/2018 13:01, Ryan Stone wrote: > I would guess that the calibration can fail because when running under > the hypervisor, the FreeBSD guest code can be descheduled at the wrong > time. As I recall, the current algorithm looks like: > > 1. Sample rdtsc > 2. Use a fixed-frequency timer to b

Re: TSC calibration in virtual machines

2018-06-27 Thread Ryan Stone
I would guess that the calibration can fail because when running under the hypervisor, the FreeBSD guest code can be descheduled at the wrong time. As I recall, the current algorithm looks like: 1. Sample rdtsc 2. Use a fixed-frequency timer to busy-wait for exactly 1 second 3. Sample rdtsc again

Re: TSC calibration in virtual machines

2018-06-27 Thread Alan Somers
On Wed, Jun 27, 2018 at 11:05 AM, Jung-uk Kim wrote: > On 06/27/2018 12:47, Alan Somers wrote: > > On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim > <mailto:j...@freebsd.org>> wrote: > > > > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > >

Re: TSC calibration in virtual machines

2018-06-27 Thread Jung-uk Kim
On 06/27/2018 12:47, Alan Somers wrote: > On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim <mailto:j...@freebsd.org>> wrote: > > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > It seems that TSC calibration in virtual machines sometimes can do more >

Re: TSC calibration in virtual machines

2018-06-27 Thread Alan Somers
On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim wrote: > On 06/27/2018 03:14, Andriy Gapon wrote: > > > > It seems that TSC calibration in virtual machines sometimes can do more > harm > > than good. Should we default to trusting the information provided by a > hypervis

Re: TSC calibration in virtual machines

2018-06-27 Thread Jung-uk Kim
On 06/27/2018 03:14, Andriy Gapon wrote: > > It seems that TSC calibration in virtual machines sometimes can do more harm > than good. Should we default to trusting the information provided by a > hypervisor? > > Specifically, I am observing a problem on GCE instances wh

Re: TSC calibration in virtual machines

2018-06-27 Thread John Baldwin
On 6/27/18 12:14 AM, Andriy Gapon wrote: > > It seems that TSC calibration in virtual machines sometimes can do more harm > than good. Should we default to trusting the information provided by a > hypervisor? > > Specifically, I am observing a problem on GCE instances wh

TSC calibration in virtual machines

2018-06-27 Thread Andriy Gapon
It seems that TSC calibration in virtual machines sometimes can do more harm than good. Should we default to trusting the information provided by a hypervisor? Specifically, I am observing a problem on GCE instances where calibrated TSC frequency is about 10% lower than advertised frequency