Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3500332imm; Fri, 19 Oct 2018 11:38:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV62cPmzkn9MS4uSyvkvoex998VQm3l0a/mvkcnOny41S9QuPfzR2v2OYejQaRCMERe0mNCQR X-Received: by 2002:a63:5558:: with SMTP id f24-v6mr34485818pgm.37.1539974283868; Fri, 19 Oct 2018 11:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539974283; cv=none; d=google.com; s=arc-20160816; b=N1hC6CKEEDO2JkLKcI1iLb+KAAt2IHHctjS5qhDolL2GXVhAuAg68X5G2Lh+iCKq59 CVyuhCVD7ZaKUJBrn+bQXbTJuSdP3d09CYnKtzzBKeLbYTDjg6f8GJA1q6WDO7fHOOWg HRoeBldzC6hjtvly9iP7AHXYe/X4qxe+iwTuXSKrdcWwcR31zFWoRKFNezO4FoaJFaPY bKn90a9fwu7j6KV984orjhQLCF7tvV36ULDk8edG7U+qUOo96AbaTj7cYxKUQBydYnTp 0wMcgj4tkWFAg9d0aZn23TsaKXrVXoqJd2L8zkpEufiBJvP6bdksEtMmvbO7npmudZjZ nRVQ== 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=/lNKcIK2X1wfOIZMzDciGYFS1/xcKDiaWi7fLuHRwOo=; b=tbute0J8/oHfsIIzPF2LUZWwD3HOGervCnASl9tlaoSco3fXEYY4Kq2vBA8hYxPqrT R8xjscgeFW79o+LVHz7a0ZIS8LUSOSN4L3w9npUtgQIeBa/08LACaNNpBkrHE0guZ/sS sU3haC1Bm94sj/DzGI0cTFwRqeoUB3jL8N5o5JdXoSthVMw3kXZ3JnyDqQdoCrUJeAo4 jS+ZFiMSnDSowtJj+FoJAylZcvlyVjxpPKANAcCv2ziYbMORtxPVf4lfd9xPqChl1pPV Pf7R67UyArA8Pkj09ZJp7+V7XDC+XeD++A6WEfHQ0O11bFzM7JkltZ1/cJveANhcNdJL DK0g== 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 bj12-v6si23821952plb.178.2018.10.19.11.37.48; Fri, 19 Oct 2018 11:38:03 -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 S1727740AbeJTCom (ORCPT + 99 others); Fri, 19 Oct 2018 22:44:42 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40008 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727193AbeJTCom (ORCPT ); Fri, 19 Oct 2018 22:44:42 -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 1gDZe0-0004T3-2G; Fri, 19 Oct 2018 20:37:08 +0200 Date: Fri, 19 Oct 2018 20:37:07 +0200 (CEST) From: Thomas Gleixner To: Christopher Hall cc: "H. Peter Anvin" , linux-rt-users , jesus.sanchez-palencia@intel.com, gavin.hindman@intel.com, liam.r.girdwood@intel.com, Peter Zijlstra , LKML , John Stultz 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 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. 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. John? Thanks, tglx