Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1149290imd; Thu, 1 Nov 2018 10:58:22 -0700 (PDT) X-Google-Smtp-Source: AJdET5d/QiuMSsaxCxhV50YT+wF4w8Sndfe3Dvk4M9NOOe0bS6HOcNMWKmrNz37wPwbQJNjc8AhK X-Received: by 2002:a62:1954:: with SMTP id 81-v6mr8624045pfz.237.1541095102806; Thu, 01 Nov 2018 10:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541095102; cv=none; d=google.com; s=arc-20160816; b=gafAyXhShLFpdROybk2Doh3Jgx97EB/sSkJ7QpHOBoq7MQvGs4y8gf3ErF1LarnxpT eqkLMo49nrt2eqTxH4dqz1G966Hjm6Ao+JNFVHXZtmd7BAljKiRgNlDq0Hwx2kHUv7ZC meiB88DVrRqm1GvF0+56EfHbKqi143bQnqgkNGDPyUY0MCGZ52lxyG39/juKfQHoEjZQ ayhs/CyYuu2jhz1xVRUp0ITRV2+UIrMvrDVroYRyRj7MkCNFvTkxA8sNt+7mR2Q+iwY5 FJMJypTvhVn/hODMio+C9Wdu/2v9qOPtyP2ALtpO8zkVp30tsM1iYGT+pHqZi5GJq4UL VHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=nKXgcVwO8dM4jvqQU7QDD2B8DoDlWrqDfj4kGWQY3iU=; b=oDw9Gx5dHO1FEp0E+9xzqFbA5K/Y/yxzlXUX8OeesbCiRJp/I9My8Dp2InC2bH6qev 7xuToyuEUcluUYZLdaFV1nMh5eINaskrsV7rcS6r8+zZH/aH4J8zqScpOaNFnvVH6j49 d+bsTf7UPLVJoM+8KJaWb6dBHgFpuIkXBtPaShIqpyhbb/GBE2xzhlK8WuyH0dxzjECf Ben7FVmMXGQ2KKbt7sYsDokeEMef7x7irdsXzJbLAqmKZuTV/cAXHTUZAxM69YnlEU+y BvNJZTWV65MMhMg9OzbUP+xwc2J1ezYzdGruEoJZ/vYxqCFiedaJfdgtrZYRnsJet4FK MBQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=blXMwtiG; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si62292pfi.99.2018.11.01.10.58.06; Thu, 01 Nov 2018 10:58:22 -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; dkim=pass header.i=@linaro.org header.s=google header.b=blXMwtiG; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbeKBDAX (ORCPT + 99 others); Thu, 1 Nov 2018 23:00:23 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:37065 "EHLO mail-wm1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727836AbeKBDAX (ORCPT ); Thu, 1 Nov 2018 23:00:23 -0400 Received: by mail-wm1-f52.google.com with SMTP id p2-v6so2024439wmc.2 for ; Thu, 01 Nov 2018 10:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nKXgcVwO8dM4jvqQU7QDD2B8DoDlWrqDfj4kGWQY3iU=; b=blXMwtiGHuF5vHAoBxSMOKriSdCKs0oLJ7AcslVZwdrNGSJ5vFwRbgpMK2CArY9iXR 0KJ8Gcus7FRGtbvCAOHb1zLk+xXWrrMqzNsUrU5zZ3ZsbRJX3MEziqY7H02dccQMGkj7 wm8aGa1ozwsz3mwQh4UNFY8czaMW/rNa4A0G4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nKXgcVwO8dM4jvqQU7QDD2B8DoDlWrqDfj4kGWQY3iU=; b=WNqadfRXW/YELR8dZAnChXHJQBq2n42ZJQ/rHI0UjCR6408VbpVBT41t9VJheCa9yu yG9XU+6gYMBYXYhGfJDJX0e9OQ4DceO0XgpGMuIByTUEswC49YVc9uOaEGrrM3EKrLCZ GPRC9yYvaZO+3PMJnCc98e1yXK8FWiDKQ7AYbEY5BCQJndm/cpbtrl86DVH9eEAhbtrQ o3UNACK4fzf+2xd7XCPLwrsKSshXwcSPKWwvnhkcTDumh+XP6uQYyxLntHQ2ZnYmayB7 OGabOCYkyBVe7v01Ob55E7iOo60HfDhGMoLw/14Ziq03Zq7QUCAjfK67lIWn/1ZreDU4 m0vQ== X-Gm-Message-State: AGRZ1gL0Dbk9WEwlAwPmDoDCGNiyV2yZjtREz85rFldVy+VfNs94axaY P9AoFjJ/KBph470o5JXmt6jmWrUxHLzZ7lNpxGjcAg== X-Received: by 2002:a1c:bce:: with SMTP id 197-v6mr6007738wml.15.1541094981383; Thu, 01 Nov 2018 10:56:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:4054:0:0:0:0:0 with HTTP; Thu, 1 Nov 2018 10:56:20 -0700 (PDT) In-Reply-To: References: <20181015160945.5993-1-christopher.s.hall@intel.com> From: John Stultz Date: Thu, 1 Nov 2018 10:56:20 -0700 Message-ID: Subject: Re: TSC to Mono-raw Drift To: Thomas Gleixner 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Otherwise with no correction, the raw clock and the monotonic clock would drift apart. thanks -john