Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2015 21:41:29 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        Paul Vixie <paul@redbarn.org>
Cc:        "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: bhyve clock problem, solved by kern.timecounter.hardware="TSC-low" in /etc/sysctl.conf
Message-ID:  <CAFgRE9EqgP%2B4WZdY3%2BJU3dGDTujgwpK5VD9Xd=1y2T-9jssyug@mail.gmail.com>
In-Reply-To: <552809F4.6070206@redbarn.org>
References:  <552809F4.6070206@redbarn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Paul,

On Fri, Apr 10, 2015 at 10:35 AM, Paul Vixie <paul@redbarn.org> wrote:
> here is a representative one-hour sample of ntp messages from
> /var/log/messages on a freebsd 10.1 bhyve guest:
>
>> Apr 10 12:00:46 family ntpd[634]: time reset -0.613057 s
>> Apr 10 12:17:02 family ntpd[634]: time reset -0.604933 s
>> Apr 10 12:33:51 family ntpd[634]: time reset -0.650622 s
>> Apr 10 12:55:06 family ntpd[634]: time reset -0.743930 s
>
>
> that's with kern.timecounter.hardware: HPET, which is the default.
>
> a "time reset" from ntpd means the clock either won't slew at all or
> can't slew fast enough. in other words a normal freebsd 10.1 server can
> run for months or even years without ever outputting one of these messages.
>
> google reports that some folks have had good luck with
> kern.timecounter.hardware: TSC-low. so i tried that on another freebsd
> 10.1 bhyve guest on the same bhyve server, with dramatic results -- no
> more ntpd messages.
>
> can we make TSC-low the default?
>

The choice of using the TSC is not without issues:

- As rstone@ points out the TSCs need to be synchronized across physical cpus.

- Depending on system load the guest's estimate of the TSC frequency
might be way off the mark.

So, in a way the HPET or the ACPI time counters are better since both
the host and guest agree on the frequency. But it seems there is
either an issue with the emulation or an artifact due to the
guest-to-host round trip time.

I have been doing experiments but don't have anything conclusive yet.

best
Neel

> vixie
>
>
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFgRE9EqgP%2B4WZdY3%2BJU3dGDTujgwpK5VD9Xd=1y2T-9jssyug>