From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbcHLRXZ (ORCPT ); Fri, 12 Aug 2016 13:23:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60254 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752164AbcHLRXY (ORCPT ); Fri, 12 Aug 2016 13:23:24 -0400 Message-ID: <1471022601.32433.2.camel@redhat.com> Subject: Re: [PATCH] time,virt: resync steal time when guest & host lose sync From: Rik van Riel To: Paolo Bonzini , Wanpeng Li Cc: Frederic Weisbecker , Ingo Molnar , LKML , Peter Zijlstra , Wanpeng Li , Thomas Gleixner , Radim Krcmar , Mike Galbraith Date: Fri, 12 Aug 2016 13:23:21 -0400 In-Reply-To: References: <1468421405-20056-1-git-send-email-fweisbec@gmail.com> <1468421405-20056-2-git-send-email-fweisbec@gmail.com> <1470751579.13905.77.camel@redhat.com> <20160810125212.78564dc2@annuminas.surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-VB6HGkYyby/cSvoCDNnY" Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 12 Aug 2016 17:23:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-VB6HGkYyby/cSvoCDNnY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2016-08-12 at 18:33 +0200, Paolo Bonzini wrote: >=20 > On 10/08/2016 18:52, Rik van Riel wrote: > > Paolo, what is your opinion on this issue? > >=20 > > I can think of all kinds of ways in which guest and host might lose > > sync with steal time, from uninitialized values at boot, to guest > > pause, followed by save to disk, and reload, to live migration, > > to... >=20 > Guest and host _cannot_ lose sync because there is only one copy of > the > values.=C2=A0=C2=A0When the host wants to update the steal time value it = just > reads the old value and writes the new value.=C2=A0=C2=A0There cannot be = a > guest > pause, save to disk, live migration or whatever between these two > steps > (and uninitialized values at boot are not how percpu values work). There is one copy of=C2=A0paravirt_steal_clock(smp_processor_id()), but what keeps it in sync with this_rq()->prev_steal_time? Is it something simple like them both being zeroed out when the structures are first allocated at boot time? > Your hypothesis of lost ticks makes the most sense to me, and then > changing the argument to ULONG_MAX is the right thing to do. I sent out a patch that just removes the parameter instead, and documents why steal_account_process_time can encounter more elapsed time than the calling functions expected. --=20 All Rights Reversed. --=-VB6HGkYyby/cSvoCDNnY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXrgYJAAoJEM553pKExN6DSW4IAIXeWIPSV8DKgBST98migt1F aFmSMYmeZ/gQ7CSjN578iikMeYHa4QpTBdxqRvt4fOzrF7NE8zkJx28dagIj4LGX YW0MgfnxrBJgZLCeegvn4rA3Vd7/l9OII9aqZAUP80QLqY4TbfhlHATPHE2DohMK UaiT37OG5LF7SqIX7PuMMUIT2w64BaHY6glO4MYlGch7REQiZoJDTTlmTOuMwXuv Fa/V8DrajwITpXQXE4H30pts1KJ+6Swtmj8pF3/O/TYkCb23Hycd/ZLGesJujLiC mfyGW2LS8lwzt7oeQ7Jfb2m6gbGrvy70qCk/2CuZbkLEf0WwEOQDLl8wKyizsYQ= =8oD2 -----END PGP SIGNATURE----- --=-VB6HGkYyby/cSvoCDNnY--