Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1166335imd; Thu, 1 Nov 2018 11:12:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5cO8RbJPXrq+aJshPS6ppzVIBWSIfxun4dhMMZCicyK2qoEr8n0kYw+6/pugDuUyPTktZt6 X-Received: by 2002:a62:6d04:: with SMTP id i4-v6mr8590346pfc.131.1541095924842; Thu, 01 Nov 2018 11:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541095924; cv=none; d=google.com; s=arc-20160816; b=qAMwbJtemGhDREKdNhxpXEOPcoxGUbcSH/3AL1UmXOZcKqgtojm0/VavFzG95sOBpk LznaIWP5s/6jHR/Cot90LXBd2XaSpUrVjhDLKjN46rI2WosKbZw+HroxLQGiOEBO+FwV /KOaA/2TEYgrPYSkKTCzfObnxM4Qmmjjivy35YZGx+ys1GDr9xp3vNzGcFTfzF2gTLrz 597vzd/CbhxFtsZO6CbuBqdescUJ2I/5ZFYKs4vYL1Q2UAQ5bUyUz2vmqfTEn2SNm6t0 +J74YwuhHXIiWFolVkHnX/27p6zbpmnVz7GdymhrO8PKfXVJF0d9g9GAXRWZsvd2dO9e tJzg== 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=b/Nac/CRBlAjzOyrcRR6ce4VBXNF+V8CH88uaA3nQYA=; b=RFF5JMu/LU56M0BZgbDQl/vBuO8XwUk0dpZcP2bWMSokMBSJNduUvZoJMLIuYhQzl0 Zms52tuhjso/zPP1QgOF09xz8boagv9w1s2SIXPziHr0Q83+irO4qPIUTcX/lGJ07vjP maNtjnzmn+BoJbb6ErV4SX9LhpCf0JeJT2Y2sjWArIP4x/dqjt9txInc758FOTPcDW4R f+3DZ6N1Vv/3SxDDjNCLjaGRdGlZatQsibtc6zn/g/NsaXVxI2FDkA8a5e4uO3BaPTqm 5YFgiqaP/pvBrbhA8Kv0GRSk6u9wguHmatJElxOCNp967l5EmPDjhPzMEwHs0LGgPWV/ aaHQ== 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 i4-v6si14121387pfg.185.2018.11.01.11.11.44; Thu, 01 Nov 2018 11:12:04 -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 S1727970AbeKBDH7 (ORCPT + 99 others); Thu, 1 Nov 2018 23:07:59 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57917 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbeKBDH7 (ORCPT ); Thu, 1 Nov 2018 23:07:59 -0400 Received: from p5492fe24.dip0.t-ipconnect.de ([84.146.254.36] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gIHJh-00088J-Sg; Thu, 01 Nov 2018 19:03:38 +0100 Date: Thu, 1 Nov 2018 19:03:37 +0100 (CET) From: Thomas Gleixner To: John Stultz cc: Christopher Hall , "H. Peter Anvin" , linux-rt-users , jesus.sanchez-palencia@intel.com, Gavin Hindman , liam.r.girdwood@intel.com, Peter Zijlstra , LKML , Miroslav Lichvar Subject: Re: TSC to Mono-raw Drift In-Reply-To: Message-ID: References: <20181015160945.5993-1-christopher.s.hall@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > >> On Fri, Oct 19, 2018 at 3:36 PM, John Stultz wrote: > >> I spent a little bit of time thinking this out. Unfortunately I don't > >> think its a simple matter of calculating the granularity error on the > >> raw clock and adding it in each interval. The other trouble spot is > >> that the adjusted clocks (monotonic/realtime) are adjusted off of that > >> raw clock. So they would need to have that error added as well, > >> otherwise the raw and a otherwise non-adjusted monotonic clock would > >> drift. > >> > >> 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. > Otherwise with no correction, the raw clock and the monotonic clock > would drift apart. They drift apart today already if you do NTP correction. They stay in sync w/o NTP/PTP/PPS. But maybe I confused myself completely by now. Thanks, tglx