Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2000732imd; Fri, 2 Nov 2018 04:27:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5c28cQVTLzYYy5BkN9phsOGWutf/og8E6Hsblkaje1d+/43qa/XiGjuWrJ+9za+3/ajxjpG X-Received: by 2002:a63:81c7:: with SMTP id t190mr8063140pgd.393.1541158034805; Fri, 02 Nov 2018 04:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541158034; cv=none; d=google.com; s=arc-20160816; b=pt1kQf+U+PPdGlGhtcOuQt0gFaQvhC/6ocM176GepFXBwzJNM3FKEiAyTVviCbvTwB 1YEWRm4VfmqfHMlhLQuCXhm5w+wHw8gh6RHAdcqq1/+7k1tbNKPxjZs7Jkdhy6sc2CL7 uuWKe4+kDjsA+vhOKRMxB69e+69dyFlcztqfqVRxRLFgtbXTBOHF90msODkAPhMljdaj jpHZ5kUUId603KKzDt4pwAfYNoaYEQebhPaJZud3ki+gdmkhein0ocjbkvjD6Rf837Cd 54LjgxiFEIGxNTdgye7OfGA6zKyWKCEFN1ywxYUDRWnlVZ1cuhykJlZuJGWjEx6AP+/5 l6gw== 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=RpVXla65AhU66b6nBMOkFjsC+EFOw7a6KINCtLSyjzg=; b=gqmaBcWVpdo2bfaA3pZ+g3WlGBV8gg0O0jklDfF+IT0wNry0gaWtgVCVQI9h9PlJOM g1Gb+hK2u/mqLpvmwAEC8irg23LZaLhA3904xppyDErZeAHa+kys5mMeOLmHcAqAsOLd RqMJBPGY4YMttzpgDKxTHo4T/TXanoa4HUeM8ya9MbK9fwC/iaDkWb7YyxI3eB7uqxc5 MB9c3mOrND/eYQrHCAigjM2tZEMrexqJxjubnQzJdpvfUNmuu1JmdyQGYMk8rsfM1Ryt zucI9+I4ZzQ6dnDwN9lNGFrhjrc8tDUPL4qeqRMOpjBMRg8LZjrSO80GiNgmqJsHXfJR GaoQ== 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 d10-v6si3410670plo.184.2018.11.02.04.27.00; Fri, 02 Nov 2018 04:27:14 -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 S1727648AbeKBUdF (ORCPT + 99 others); Fri, 2 Nov 2018 16:33:05 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58990 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbeKBUdF (ORCPT ); Fri, 2 Nov 2018 16:33:05 -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 1gIXaO-00041t-PY; Fri, 02 Nov 2018 12:25:56 +0100 Date: Fri, 2 Nov 2018 12:25:56 +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: <20181102112006.GM19434@localhost> Message-ID: References: <20181102112006.GM19434@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 On Fri, 2 Nov 2018, Miroslav Lichvar wrote: > On Thu, Nov 01, 2018 at 07:03:37PM +0100, Thomas Gleixner wrote: > > On Thu, 1 Nov 2018, John Stultz wrote: > > > On Thu, Nov 1, 2018 at 10:44 AM, Thomas Gleixner wrote: > > > > On Tue, 23 Oct 2018, John Stultz wrote: > > > >> However, to be correct, the ntp adjustments made would have to be made > > > >> to both the base interval + error, which mucks the math up a fair bit. > > > > > > > > Hmm, confused as usual. Why would you need to do anything like that? > > > > > > Because the NTP adjustment is done off of what is now the raw clock. > > > If the raw clock is "corrected" the ppb adjustment has to be done off > > > of that corrected rate. > > > > Sure, but why would that require any change? Right now the raw clock is > > slightly off and you correct clock monotonic against NTP. So with that > > extra correction you just see a slightly different raw clock slew and work > > from there. > > It makes sense to me. > > I think there are basically two different ways how it could be done. > One is to correct the frequency of the raw clock, on which sits the > mono/real clock. The other is to create a new raw clock which is > separate from the mono/real clock, and add an offset to the NTP > frequency to match the frequencies of the two clocks when not > synchronized by NTP/PTP. The latter would provide a more stable > mono/real clock. > > clocksource -> MONOTONIC_RAW -> MONOTONIC/REALTIME > > or > > clocksource -> ? -> MONOTONIC_RAW > -> MONOTONIC/REALTIME That's what we have now. At least I don't see how the raw thing is coupled in NTP. Thanks, tglx