From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5235CC32789 for ; Fri, 2 Nov 2018 11:20:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D25F820657 for ; Fri, 2 Nov 2018 11:20:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D25F820657 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbeKBU06 (ORCPT ); Fri, 2 Nov 2018 16:26:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42900 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbeKBU06 (ORCPT ); Fri, 2 Nov 2018 16:26:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8805307CDC6; Fri, 2 Nov 2018 11:20:09 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6D4B5D6A9; Fri, 2 Nov 2018 11:20:07 +0000 (UTC) Date: Fri, 2 Nov 2018 12:20:06 +0100 From: Miroslav Lichvar To: Thomas Gleixner 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 Message-ID: <20181102112006.GM19434@localhost> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 02 Nov 2018 11:20:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Miroslav Lichvar