From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753069AbcHNI7c (ORCPT ); Sun, 14 Aug 2016 04:59:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33558 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbcHNI7a (ORCPT ); Sun, 14 Aug 2016 04:59:30 -0400 Message-ID: <1471139439.32433.12.camel@redhat.com> Subject: Re: [PATCH] time,virt: resync steal time when guest & host lose sync From: Rik van Riel To: Ingo Molnar Cc: Wanpeng Li , Frederic Weisbecker , LKML , Paolo Bonzini , Peter Zijlstra , Wanpeng Li , Thomas Gleixner , Radim Krcmar , Mike Galbraith Date: Sat, 13 Aug 2016 21:50:39 -0400 In-Reply-To: <20160813084247.GA20927@gmail.com> 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> <20160813084247.GA20927@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-Gkc2Yp8N26GjrqdlwXDM" Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 14 Aug 2016 01:50:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-Gkc2Yp8N26GjrqdlwXDM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2016-08-13 at 10:42 +0200, Ingo Molnar wrote: > * Rik van Riel wrote: >=20 > > On Wed, 10 Aug 2016 07:39:08 +0800 > > Wanpeng Li wrote: > >=20 > > > The regression is caused by your commit "sched,time: Count > > > actually > > > elapsed irq & softirq time". > >=20 > > Wanpeng, does this patch fix your issue? > >=20 > > 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 > > ---8<--- > >=20 > > Subject: time,virt: resync steal time when guest & host lose sync > >=20 > > When guest and host wildly disagree on steal time, a guest can > > do several things: > > 1) Quickly account all the steal time at once (the kernel did this > > before > > =C2=A0=C2=A0=C2=A057430218317e ("sched/cputime: Count actually elapsed = irq & > > softirq time"), > > =C2=A0=C2=A0=C2=A0when steal_account_process_ticks got ULONG_MAX as its= maximum > > value. > > 2) Stay out of sync for an indeterminate amount of time. This is > > what the > > =C2=A0=C2=A0=C2=A0system does today. > > 3) Sync up the guest value to the host-provided value, without > > accounting > > =C2=A0=C2=A0=C2=A0an absurdly large value in the cpu time statistics. > >=20 > > This patch makes the kernel do (3), which seems like the right > > thing > > to do. > >=20 > > The exact value of the threshold use probably does not matter too > > much, > > as long as it is long enough to cover all the timer ticks that > > passed > > during an idle period, because (irqtime_)account_idle_ticks can > > process > > a large amount of time all at once. > >=20 > > Signed-off-by: Rik van Riel > > Reported-by: Wanpeng Li > > --- > > =C2=A0kernel/sched/cputime.c | 12 +++++++++++- > > =C2=A01 file changed, 11 insertions(+), 1 deletion(-) >=20 > fails to build on x86 allnoconfig: >=20 > =C2=A0 kernel/sched/cputime.c:524:10: error: too many arguments to > function =E2=80=98steal_account_process_time=E2=80=99 Which patch did you apply? =C2=A0The subject and comment of the email suggest you tried applying the one Paolo and Frederic objected to. The compile error suggest you applied the patch with the subject "time,virt: do not limit steal_account_process_time" In that case, did you apply Wanpeng's patch that adds an additional call site for steal_account_process_time? I do not have that patch in my tree yet, and one additional line of change will be needed. --=20 All Rights Reversed. --=-Gkc2Yp8N26GjrqdlwXDM 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 iQEcBAABCAAGBQJXr85vAAoJEM553pKExN6D2J8H/25P5Nlx1CBTvD6ZiJ0oDw6P HZGBBa75J6Abfc45qM0sNr63ElL90P7l364tpeLWsPwmHohQ7KNwJRGxewBR7dnq /d/WX7Assimiv7rXcSXlednsrT1mr1vsSxJhA9tOBKDUDqGQi8kMzSZQexyJJcSr 7BxfczUeB+9GO6Sb4MDHKOTXfS/nNhWw+yX5it5Y4WMOb07a0P4kqWvhb3pAAXEQ Ny+Kyuc/tY78vwIbXGBgBZj2o1SUFZT2GKTZTPg0g8ns6NpSFFblmvfl2qZjtlO6 pWT9wHpksXghzqL4L9kxQVkd3jYt9dernqHH47tvNodDr8SsTp4mUvup4s5ECas= =josX -----END PGP SIGNATURE----- --=-Gkc2Yp8N26GjrqdlwXDM--