Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp266167imu; Thu, 3 Jan 2019 19:20:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wm9bN1nRz0HbDHgCuMXYILFvzQu/57UseK066lysRS+CIg/ZEmI6h0jPAhLTdoSrDbnpqA X-Received: by 2002:a62:4156:: with SMTP id o83mr50614909pfa.72.1546572002280; Thu, 03 Jan 2019 19:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546572002; cv=none; d=google.com; s=arc-20160816; b=zCvEb/7BI0z47BxLsF1a5ZvcrjGLxnzgaElUF0wTVXeHGTQtfc9SF1emrCckC+ITQA HC5+JG/7AL6wudjyS/kfScl1Jm95p+qu3MNqmgs7nZaEXj4Zh9Rk5SK1OiU8m8pWYgua erJePflWHc2GkSNH+RWS2PDaOXD8UDsnO7/P5pSqU/mUHOmATnT2t/PIvO/29ERaZgP5 rUPS2Ta+qYuHMaeRG6CfrxHoiZIjtfzztot23bfEaLBsV/CUS3+A04OlS7i3SUuw9b9y zvdfDLGQscvlSeTxGSco8YauukJabr1mMUT42zOx63Mjm2rmno3vZAVSDL8VbncU6YTS J9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tHdsUEewYXSe8Kadix+ZY90aufWKaK0mZq33dBRtvTk=; b=pvY4z38dqpjDrCzMXnkQmZUYYtBVkBtkwi0Vd8AqDcLBDm91F3v9Msf/3gEFipCuSy b0ioJi2TurCO9on6kxJbW3WR5M6NERe2NkHrNW3ASpRiUOh73nhOf+xx3XJIX4yTgbnv acJQI1KFuBhwjrstGmsltXoxVuKloPAoI40LlvrVM0CBlexLL2zv7t/EAHuScw2pFijJ zcVEUG+5uA7Nb4dn+asHBsvoDuUrCsbRrJ9QGMjIL5EgrBdtvLs0riWXsbRe6nIKB4GJ uZ7NwZrWyCI2sGawyc3SHSLtFPxU2wPgcgWL2EcoCJq1KaTityWLh0J8wUseOxBlgCJt Wq1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=J85VsFqy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m38si1150917pgl.125.2019.01.03.19.19.47; Thu, 03 Jan 2019 19:20:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=J85VsFqy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727899AbfACV3J (ORCPT + 99 others); Thu, 3 Jan 2019 16:29:09 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:40786 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727433AbfACV3J (ORCPT ); Thu, 3 Jan 2019 16:29:09 -0500 Received: by mail-ed1-f67.google.com with SMTP id g22so30159520edr.7 for ; Thu, 03 Jan 2019 13:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tHdsUEewYXSe8Kadix+ZY90aufWKaK0mZq33dBRtvTk=; b=J85VsFqy45Pa1s5bDdQGYYTinaa8O5I3TNHJY1b3i6V2dLg1x4RXAyrngOqZu6GpVL hBSl2n5q3NPPeoQjc64kD8Itv48U1Fx8RHvfNkowg1IYiQ83s0010ogtg43f45rKpkya OEllt4ReHX4CUWRCEJvXLsnOl9+8PWbZjcNrI+P4m8LiPpRcpMIYtQYvMKS6p9byy1uM JiwgD3irlXBIlPjJwwe3N/C/f2JVUwC2mOOjP30cOwNhKtKT3lsNN+RBf0jpBnGscRG+ GpT1lfMHMhNGKXAoaS6uhNVsLlbzIIhSHdiHv5xi9IDnrO91nuzbqlfoMQu6HmXTDYZh 2mVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tHdsUEewYXSe8Kadix+ZY90aufWKaK0mZq33dBRtvTk=; b=KhWVi0Vod0PmCM2TwdnvRZJONOnui/Yp05/M52+JS4GazR0axtXtIxeMIzfZE0brCv XXmQns8fZ7LF+bHfY/o/WFTHVbNRnLvk6XLR1aqrsJFUqHQo0gwRk1zKwZK9ys6N1Zzn 0vVp/iWAyywgmF9d7gZKS/3zXLFyJstuvQES8q1LJAKOBgNwJx3ccBCyQvK3Bn8Xwvma jsXCJm+ywnSOdjByR4Ku51I2wyE6JN9m2/o/l7uH+DwB5VK5ptHxP19SOp2nq7sS7B1v pp4la8SQMcRfgFooNL3qONtvPxyTG2jBUMO+hRbuM55ieNxWrqPo8zAqT4rFxUL8SdCu FLiw== X-Gm-Message-State: AA+aEWZHNTWOCAisdnXREclEKPEnC28UG/gMY2RZoPiYA2OWGQ3kJQOx jdtJ5fLzqeasfWFWnyEMud9eWFT0gvP2Uvnp4SvhxQ== X-Received: by 2002:a50:9a42:: with SMTP id o60mr45166776edb.180.1546550947080; Thu, 03 Jan 2019 13:29:07 -0800 (PST) MIME-Version: 1.0 References: <20180719205545.16512-1-pasha.tatashin@oracle.com> <20180719205545.16512-24-pasha.tatashin@oracle.com> <20181106054212.GA31768@nautica> <95c3920e-bf80-0c7e-7854-01a1c3189c23@oracle.com> <20190102202032.GA1034@eldamar.local> In-Reply-To: <20190102202032.GA1034@eldamar.local> From: Pavel Tatashin Date: Thu, 3 Jan 2019 16:28:56 -0500 Message-ID: Subject: Re: [PATCH v15 23/26] sched: early boot clock To: Salvatore Bonaccorso Cc: Steven Sistare , Dominique Martinet , Pavel Tatashin , Daniel Jordan , linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, LKML , mingo@redhat.com, Thomas Gleixner , hpa@zytor.com, douly.fnst@cn.fujitsu.com, Peter Zijlstra , prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, qemu-devel@nongnu.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Could you please send the config file and qemu arguments that were used to reproduce this problem. Thank you, Pasha On Wed, Jan 2, 2019 at 3:20 PM Salvatore Bonaccorso wrote: > > Hi, > > On Tue, Nov 06, 2018 at 06:35:36AM -0500, Steven Sistare wrote: > > Pavel has a new email address, cc'd - steve > > > > On 11/6/2018 12:42 AM, Dominique Martinet wrote: > > > (added various kvm/virtualization lists in Cc as well as qemu as I don't > > > know who's "wrong" here) > > > > > > Pavel Tatashin wrote on Thu, Jul 19, 2018: > > >> Allow sched_clock() to be used before schec_clock_init() is called. > > >> This provides with a way to get early boot timestamps on machines with > > >> unstable clocks. > > > > > > This isn't something I understand, but bisect tells me this patch > > > (landed as 857baa87b64 ("sched/clock: Enable sched clock early")) makes > > > a VM running with kvmclock take a step in uptime/printk timer early in > > > boot sequence as illustrated below. The step seems to be related to the > > > amount of time the host was suspended while qemu was running before the > > > reboot. > > > > > > $ dmesg > > > ... > > > [ 0.000000] SMBIOS 2.8 present. > > > [ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20180724_192412-buildhw-07.phx2.fedoraproject.org-1.fc29 04/01/2014 > > > [ 0.000000] Hypervisor detected: KVM > > > [ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00 > > > [283120.529821] kvm-clock: cpu 0, msr 321a8001, primary cpu clock > > > [283120.529822] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns > > > [283120.529824] tsc: Detected 2592.000 MHz processor > > > ... > > > > > > (The VM is x86_64 on x86_64, I can provide my .config on request but > > > don't think it's related) > > > > > > > > > It's rather annoying for me as I often reboot VMs and rely on the > > > 'uptime' command to check if I did just reboot or not as I have the > > > attention span of a goldfish; I'd rather not have to find something else > > > to check if I did just reboot or not. > > > > > > Note that if the qemu process is restarted, there is no offset anymore. > > > > > > I unfortunately just did that so cannot say with confidence (putting my > > > laptop to sleep for 30s only led to a 2s offset and I do not want to > > > wait longer right now), but it looks like the clock is still mostly > > > correct after reboot after disabling my VM's ntp client. Will infirm > > > that tomorrow if I was wrong. > > > > > > > > > Happy to try to help fixing this in any way, as written above the quote > > > I'm not even actually sure who is wrong here. > > A user in Debian reported the same/similar issue (with 4.19.13): > > https://bugs.debian.org/918036 > > Regards, > Salvatore