Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1994763imd; Fri, 2 Nov 2018 04:20:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5fOUNt9c9WIEepA1C3irqoUK8XPhYuRTEn0/6WkoHs9jngfoHo9+aSJhlG0WgHBb+W7YEk8 X-Received: by 2002:a65:430b:: with SMTP id j11-v6mr10661039pgq.269.1541157646184; Fri, 02 Nov 2018 04:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541157646; cv=none; d=google.com; s=arc-20160816; b=cPNNNmm7Ac8SGIMmjMz+izE/cC7hgY674bugeHRpLSaAHP97R+ZTVs72atmW+Fc81y GbUvdTq3TP7PZ+jkHOtH7JAP29JuVFkc0s5t/ukLXFNgbzCIhrK4Rd8zPHeAVxdjD8e+ XuH7dLCiBgdWKFZM9IhsqDQR79Ukqfgr2HRtIBu51aoR/ABYjdzubq4HIUQty5TLFDb3 Kke6etFQaMOJB2bjfoi7gtFKZNrtOBHUhngszcQ7O66RVzIMZ5eaC2didm0gOO1XEIRz uf+2Z/3EG4UoX+QGkGvEKymLFv+OAn7IoXNNlKIXnSbOSIH5SUzm2JLoFVeGPsiRUmfB pKWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WorcLQdYrVSTkyHqgKh8xMH3QIF74wUgn3RznLJGhxo=; b=N0sNByChRqsQHaeUZKmivdEaC/9ttssNagK6oMBYGK8FUNqz1L56hytcYKHtnj4Mgl g+7HH/h8rscbFLR31ipABcihyBZ8SWhG2Jfkx9Bof98ldWPj2T5G0F+QbJm+Gh4goEqb 1U+KiRO62woJyPsFF8EUU8032TH8nRTFwedcuTuNMzuhjnaJaWOT8Am/1FAL7tXXRFs4 Cg/FeCClDM0P0V73SHsiY/EOjl+p+6wcCC7SW9MRyJeisn83EYYn82uVpWQtxkhqKAto rJtSzfm7v4PcZVVmqgnVMHdcZrWdruAW8Q3iFSpgeg9utqPVIcEbUzywienihlezA7DF AzHg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l68-v6si33493531pfl.268.2018.11.02.04.20.31; Fri, 02 Nov 2018 04:20:46 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbeKBU06 (ORCPT + 99 others); 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