From owner-freebsd-current@freebsd.org Wed Jun 27 15:32:46 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE9741029BCD for ; Wed, 27 Jun 2018 15:32:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7372B82EBC; Wed, 27 Jun 2018 15:32:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 62AC010AFD4; Wed, 27 Jun 2018 11:32:45 -0400 (EDT) Subject: Re: TSC calibration in virtual machines To: Andriy Gapon , FreeBSD Current References: <8ac353c5-d188-f432-aab1-86f4ca5fd295@FreeBSD.org> From: John Baldwin Message-ID: <729d4477-3c68-e3db-2ebc-0bd4deba61cd@FreeBSD.org> Date: Wed, 27 Jun 2018 08:32:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <8ac353c5-d188-f432-aab1-86f4ca5fd295@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 27 Jun 2018 11:32:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 15:32:47 -0000 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 where calibrated TSC > frequency is about 10% lower than advertised frequency. And apparently the > advertised frequency is the right one. > > I found this thread with similar reports and a variety of workarounds from > administratively disabling the calibration to switching to a different timecounter: > https://lists.freebsd.org/pipermail/freebsd-cloud/2017-January/000080.html I suspect you are probably right that we should just "trust" TSC frequencies provided by a hypervisor. We could perhaps choose to whitelist hypervisors known to provide accurate values if we wanted to be cautious. -- John Baldwin