Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3510921imm; Fri, 19 Oct 2018 11:49:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV60PmELpdCuTpKfQ1Wkvr6OzyNmYpFCwIwTv7KTPbpoH/d8a3pmorDJ2U3Zuu0hkr/jgZa1X X-Received: by 2002:a62:6383:: with SMTP id x125-v6mr35445652pfb.13.1539974993386; Fri, 19 Oct 2018 11:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539974993; cv=none; d=google.com; s=arc-20160816; b=e+ogCQ1MuOId8C89W/CbvfI+4V+AdWKofROCH3BhAMDviiOr6mwk+PCiNwZI7XIn8v D1jkw2KV4W/3Kt+WZH0Wc6wo9DqpyFMeeVaeUeUgwZU/8xkI06TSaF0Hm8hYmseUj/ED UqeLnrNurSgz9hxnn50POi+AEUVDm/typknV9K34JOGWtdls3rm2Srth9XTA5++Naqj1 3ds40U2aj7d/pEQS92tbwJUpT6FtvDIn0RnfBrCg6obKRvKGwLjMQ9heNvVbemo1IHn/ 8nKJ+VJMVO+hQIO3hkQeTi7Lb3T86hyex5fyfEXShhi9cd2rjDJqptnCedXp4+VGUutr YNyA== 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=jaa+ry8zqf5Hk7PfKXT1OzZzXKzmAEWyMKsEMHrL9zE=; b=bnEDRcksT/h0asm+I9m6zcrSzuZbUPDYgr3u7uKKPTduaaw1U5+JrPu7og56vxFkEU 9N3Fz9x/dcNa86y/fGk+D8DewdS4QdjIyQRtCKxLhRnN6vRaku4Mp+EXt+4yKLvpjQTn Y29HbD6lB6avUMQbEUKnrU01AxsI+cBRgAxlBkA5+F78+kUCtUADuKBuvVaPCrLul6nl sUFhBCKeUx9x1wQ668MRd8jaeuilVIU9tsCuxGdtMCcxpKNdgM2tkHfwSs1z+QTMF/d2 Q0j1yH2QdEl34bq6bXr1MeyQt1oJSg8jCqcccPVLlT8Pj0zIFDVKFos5WlxD7kEHns+h pzqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Iz4tpors; 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 k70-v6si1959272pge.429.2018.10.19.11.49.38; Fri, 19 Oct 2018 11:49:53 -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=Iz4tpors; 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 S1728026AbeJTC4R (ORCPT + 99 others); Fri, 19 Oct 2018 22:56:17 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38127 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727992AbeJTC4N (ORCPT ); Fri, 19 Oct 2018 22:56:13 -0400 Received: by mail-wr1-f68.google.com with SMTP id a13-v6so38457791wrt.5 for ; Fri, 19 Oct 2018 11:48:54 -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=jaa+ry8zqf5Hk7PfKXT1OzZzXKzmAEWyMKsEMHrL9zE=; b=Iz4tpors8M0knaIBPEpruelsKjkrT/Pszqv17+TzfCnyBMJuqg/GT/c8bH2RSN99Ff hSwZhr836pSf8koSQgItJM6P53q3pQDyifKk8uCQBXiibXh2m+giaVUIRNO5pWVkjMLj OkvoiLAUFYyUExU5lbH/TID3FQfk6NEuWBH/E= 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=jaa+ry8zqf5Hk7PfKXT1OzZzXKzmAEWyMKsEMHrL9zE=; b=XA37vuVX2o69OLcvJgJa0fx4G8PPdNEfyPnclwm0LN0HPiSwv0PYOKdZp+rktBOyUL 13NWaGx12XAIVSpqnBGCJs0xCgyowgIwupKzO4KwxEH/YV7s+tPieA8kSv4T3f73okfi 4gYkTLTjhESLuioPV+jgfMBYeX04WLirWDyrfVHQXDvT5NIOgIzXrbs4ovPB7A2w8jcg JviI68IbTN73z1BJmv0gLLFbSGl6ooLCPr+yuAGG9/m3dfaKUol5GBRPW4z9yqgGFmH5 YEMKqOHMIzxYMlMqsf+3Dr+yxntJ2JIc5X36gfVWtMNu6+lGuaPe/s0NDh9Zr1GABSJN 4/wg== X-Gm-Message-State: ABuFfoiKk/P1I1STcOM4I8z78Sa4l/KJwWVrTQQbhGRq+NADL7B6X+Ld OUkA/r1IABNr58XL/hrHXlBONfv/hj+Jr/Yv3zgCLXfMVJo= X-Received: by 2002:adf:a194:: with SMTP id u20-v6mr27097447wru.50.1539974933705; Fri, 19 Oct 2018 11:48:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:b485:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 11:48:53 -0700 (PDT) In-Reply-To: References: <20181015160945.5993-1-christopher.s.hall@intel.com> From: John Stultz Date: Fri, 19 Oct 2018 11:48:53 -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@intel.com, liam.r.girdwood@intel.com, Peter Zijlstra , LKML 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 Fri, Oct 19, 2018 at 11:37 AM, Thomas Gleixner wrote: > On Fri, 19 Oct 2018, Thomas Gleixner wrote: >> On Mon, 15 Oct 2018, Christopher Hall wrote: >> > TSC kHz used to calculate mult/shift value: 3312000 >> >> Now the most interesting information here would be the resulting mult/shift >> value which the kernel uses. Can you please provide that? > > But aside of the actual values it's pretty obvious why this happens. It's a > simple rounding error. Minimal, but still. To avoid rounding errors you'd > have to find mult and shift values which exactly result in: > > (freq * mult) >> shift = 1e9 > > which is impossible for freq = 3312 * 1e6. Right. > A possible fix for this is, because the error is in the low PPB range, to > adjust the error once per second or in some other sensible regular > interval. Ehh.. I mean, this is basically what all the complicated ntp_error logic does for the long-term accuracy compensation. Part of the allure of the raw clock is that there is no changes made over time. Its a very simple constant calculation. We could try to do something like pre-seed the ntpinterval value so the default ntp_tick value corrects for this, but that's only going to effect the monotonic/realtime clock until ntpd or anyone else sets a different interval rate. So I'm not particularly eager in trying to do the type of small frequency oscillation we do for monotonic/realtime for long-term accuracy to the raw clock as that feels a bit antithetical to the point of the raw clock. I guess I'd want to understand more of the use here and the need to tie the raw clock back to the hardware counter it abstracts. thanks -john