From owner-freebsd-current@freebsd.org Wed Jun 27 17:05:16 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 E92A8102D63B for ; Wed, 27 Jun 2018 17:05:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B93C871C3; Wed, 27 Jun 2018 17:05:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 5100B1EF2C; Wed, 27 Jun 2018 17:05:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: TSC calibration in virtual machines To: Alan Somers Cc: Andriy Gapon , FreeBSD Current References: <8ac353c5-d188-f432-aab1-86f4ca5fd295@FreeBSD.org> <4d7957f6-9497-19ff-4dbb-436bb6b05a56@FreeBSD.org> From: Jung-uk Kim Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdS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ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: <0984f859-bce2-3dcb-40ba-58bb61598e1b@FreeBSD.org> Date: Wed, 27 Jun 2018 13:05:10 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I6pGaQ5DvOJY0xQeNb9GGZBU4SvrZ2rst" 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 17:05:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I6pGaQ5DvOJY0xQeNb9GGZBU4SvrZ2rst Content-Type: multipart/mixed; boundary="2MGmki2NJfPcbAiF1fTO7BLsifonTMqLQ"; protected-headers="v1" From: Jung-uk Kim To: Alan Somers Cc: Andriy Gapon , FreeBSD Current Message-ID: <0984f859-bce2-3dcb-40ba-58bb61598e1b@FreeBSD.org> Subject: Re: TSC calibration in virtual machines References: <8ac353c5-d188-f432-aab1-86f4ca5fd295@FreeBSD.org> <4d7957f6-9497-19ff-4dbb-436bb6b05a56@FreeBSD.org> In-Reply-To: --2MGmki2NJfPcbAiF1fTO7BLsifonTMqLQ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/27/2018 12:47, Alan Somers wrote: > On Wed, Jun 27, 2018 at 10:36 AM, Jung-uk Kim > wrote: >=20 > On 06/27/2018 03:14, Andriy Gapon wrote: > >=20 > > It seems that TSC calibration in virtual machines sometimes can d= o more harm > > than good.=C2=A0 Should we default to trusting the information pr= ovided by a hypervisor? > >=20 > > Specifically, I am observing a problem on GCE instances where cal= ibrated TSC > > frequency is about 10% lower than advertised frequency.=C2=A0 And= apparently the > > advertised frequency is the right one. > >=20 > > I found this thread with similar reports and a variety of workaro= unds from > > administratively disabling the calibration to switching to a diff= erent timecounter: > > https://lists.freebsd.org/pipermail/freebsd-cloud/2017-January/00= 0080.html > >=20 > We already do that for VMware hosts since r221214. >=20 > https://svnweb.freebsd.org/changeset/base/221214 > >=20 > We should do the same for each hypervisor. >=20 > We probably should.=C2=A0 But why does calibration fail in the first pl= ace? Because multiple guests are sharing same physical CPUs and guest OS has no control, timing cannot be 100% accurate. > If it can fail in a VM, then it can probably fail on bare metal too.=C2= =A0 It > would be worth investigating. It does not "fail" in bare metal because we have almost complete control.= Jung-uk Kim --2MGmki2NJfPcbAiF1fTO7BLsifonTMqLQ-- --I6pGaQ5DvOJY0xQeNb9GGZBU4SvrZ2rst Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlszw8YACgkQfJ+WJvzb 8UYVxQf/ThwArM/OpiePmcwU+d5/sVUMRPnYZdRmsaYSkp+rvnBUH1e+fGJpnO+V Tu1TkpcvHNfPYwYOIE+84VP4sAcfI5Ex9wBxhZ8RrrGQ6zJKujK/kd3CALZgHMc6 QUhpHkuMbu+dBTI9uvW8RuEWlRsr4GBmk8XxOPSQlLPTsSTP9wlhWdcRdq76zsm1 jr0dUNYn8ZVeW/pAr4F/h1VF+4HhwOUJXkLQgZWJflFqzNmmaRFakkm4eT6onTBN k9mRxe1DrZ+kDjrhdgv7kjmW9TU9tt56NpC92K9+VY5nJhcuKBt3AZsmgqQ2j5g7 4gSP9ipS+Zbzj9vvwJ3RxsruD6AloQ== =mbHv -----END PGP SIGNATURE----- --I6pGaQ5DvOJY0xQeNb9GGZBU4SvrZ2rst--