Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2003188imd; Fri, 2 Nov 2018 04:30:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5eTPMi009qbGKZGwoqtqpclSwDJ6FuP2LoEVEWoowAvoD09vujDvuGHBFXaDVCpkMiAlNLu X-Received: by 2002:a63:608f:: with SMTP id u137mr10687414pgb.203.1541158210798; Fri, 02 Nov 2018 04:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541158210; cv=none; d=google.com; s=arc-20160816; b=0/kEW19dAYRxtL9Hd04pCDXQILH0w/6m5YUvkEDEcI5lddUAyCb9HDA3uLwe7BrgYl L9Yvd1T6Vv09K/DWDNZOfgxMT3DHnFeLsAPoW5OiXECIufFa+lUB6WkQPx3QZXReMPa4 UT6KwHpnVmP9p5rjLQfx9GFIsL2IMDdo4TLqmaFWXxkQp8EVRRt5uQfIio/KM7e5gG+2 IyIeyx781uwAVb/qsx0NpfaOH3WsSIlN/uq4mljIzZsdUSeH/yiuwk52OcLkxpIsXECR X6rGOXlrRWfjelEZAuPu0ym1GdwSE2Dj7a2IpdfzV59nr8ipU98nz5neuelCVMsmm5y4 cJwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=D0hFlE3Toosv68mWjZQpPDXLwTKDXy8sCjCmks+W6iE=; b=T1jSIucn1KINWlq7ch/X9v71yq+gRtweW4bVE3sM0mjzEA0l6LwgC13NpKLvhPFl9C GaFmtnGnQ09AOPcsSykQMplGzZh3DkYA4aotaqq6mVFkpJ11Ur3W0Cqg6GHouq55RQD1 DhW1mYzJZNaUoxuSGhht5YR5MBFgXMP0q13xCVEn6fCEFNWJlKWtu9P3qe1gMh2dkHkQ Y5Lac8OwzGhw2esTTTt5kiwqvNs7d78WSXYCSOnawnMa497L343TRWyg0fS7glcpN5Rt csSz/JQn6EPS3Qu917rGjNW69WmzMOF0YBIIuEQa7akvgTepbicDJdgokXDGDVvop+UJ J2Ng== ARC-Authentication-Results: i=1; mx.google.com; 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 m6-v6si32564764pgg.265.2018.11.02.04.29.55; Fri, 02 Nov 2018 04:30:10 -0700 (PDT) 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; 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 S1727677AbeKBUeY (ORCPT + 99 others); Fri, 2 Nov 2018 16:34:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58997 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbeKBUeX (ORCPT ); Fri, 2 Nov 2018 16:34:23 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gIXbh-000456-3Q; Fri, 02 Nov 2018 12:27:17 +0100 Date: Fri, 2 Nov 2018 12:27:16 +0100 (CET) From: Thomas Gleixner To: Miroslav Lichvar cc: John Stultz , Christopher Hall , "H. Peter Anvin" , linux-rt-users , jesus.sanchez-palencia@intel.com, Gavin Hindman , liam.r.girdwood@intel.com, Peter Zijlstra , LKML Subject: Re: TSC to Mono-raw Drift In-Reply-To: <20181102102613.GL19434@localhost> Message-ID: References: <20181024145113.GF12019@localhost> <20181102102613.GL19434@localhost> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miroslav, On Fri, 2 Nov 2018, Miroslav Lichvar wrote: > On Thu, Nov 01, 2018 at 06:41:00PM +0100, Thomas Gleixner wrote: > > On Wed, 24 Oct 2018, Miroslav Lichvar wrote: > > > The error is too large to be corrected by stepping on clock updates. > > > For a typical TSC frequency we have multiplier in the range of few > > > millions, so that's a frequency error of up to few hundred ppb. In the > > > old days when the clock was updated 1000 times per second that would > > > be hidden in the resolution of the clock, but now with tickless > > > kernels those steps would be very noticeable. > > > That only happens when the system was completely idle for a second and in > > that case it's a non issue because the clock is updated before it's > > used. So nothing will be able to observe the time jumping forward by a few > > or even a few hundreds of nanoseconds. > > That's great news (to me). I think we should do the same with the > mono/real clock. A periodic 4ns step would be better than a slew > correcting tens or hundreds of nanoseconds. This would be a > significant improvement in accuracy on idle systems, in theory > identical to running with nohz=off. > > Maybe I am missing some important detail, but I think we can just drop > the +1 mult adjustment and step on each update by the (truncated) > amount that has accumulated in the NTP error register. With the > changes that have been made earlier this year the clock should never > be ahead, so the step would always be forward. That sounds reasonable. > > For the regular case, where CPUs are > > busy and the update happens 100/250/1000 times per second the jump forward > > will not be noticable at all. > > I think a 4ns jump at 100 Hz might be noticeable with a good reference > clock and large number of measurements, but so would be the current +1 > mult adjustment. Indeed. Thanks, tglx