Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp931195ybl; Fri, 6 Dec 2019 08:30:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwUSyxSWZbvl7gq3eDD7vmaMRaHPcCox44X1KnAdN5QXtg0XdJhQ1f2qsuVhiH4qr9Y9PXN X-Received: by 2002:aca:b708:: with SMTP id h8mr13529189oif.126.1575649815337; Fri, 06 Dec 2019 08:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575649815; cv=none; d=google.com; s=arc-20160816; b=enJjGjVYvo/PrDkK8CKnxjEIwPMobFXvh4vEmCZ4kBRVoZyiXDm9n4TJaO/L319qoA iRwXD+Cv3OlvrePQpP4k8r2aDcIvERJ/KDO3palLtB5AvunfUNqoV0k3wtCgvMsyJJw0 WerNXpuQ0xd3VYtI6M6ABR+ULbzPqjdiZZSsODedyODu8u5RG4gjpC4MXMI0sa6qyo4h 4ozK0PmLO/h3DJ1KyyWJwJdwpuJKdqSFxDyMVOWp5esCm+BsLHdvylWZoMyu8rgcCxuO +ta+AM/2Vp7k9SucXeBaCIscwaxKFwLooe4+WYelXnw0+OcvMpUM/6R7tN19C4FLrjv/ 1oUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=z5ckHnM1JT0bjLvn3hu4ZpaORLMeQ8ST4azSjqKt/OI=; b=AqP5CyGOQf4OoNwC7E0ierqh7DfMXzDR5OOxRL3BjimPEfT8MjaD8w1hzOrks/tAhj P0sEEs6JT/j8sefsdCM2SsUuElHwLdvayuGYzvLXs8XdIvNOpNTc8x/JvijZQrjIMqXY vu09tnG4vnwQnkXja0FAoQFu6xym6r/SXMJ736bprJEeumZISel4T4xuP2AhT2x75+nw yHgbztToYCyUXtjzJCKDt1ttEwRy89lT5Z5dkiFE/l8V8uc88zm5YYA5kcvudUtkrpf4 M1+Lhzpk+ItJEa0IeMqJyP9lSA4D1ishtXCNrCxddOR3Jq9JsvvQjO7+NwXdA67h97JW 2K5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=default header.b="LBJvUu/r"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d199si7042904oib.226.2019.12.06.08.30.02; Fri, 06 Dec 2019 08:30:15 -0800 (PST) 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=@protonmail.com header.s=default header.b="LBJvUu/r"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726352AbfLFQ3e (ORCPT + 99 others); Fri, 6 Dec 2019 11:29:34 -0500 Received: from mail-40138.protonmail.ch ([185.70.40.138]:11488 "EHLO mail-40138.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfLFQ3e (ORCPT ); Fri, 6 Dec 2019 11:29:34 -0500 X-Greylist: delayed 600 seconds by postgrey-1.27 at vger.kernel.org; Fri, 06 Dec 2019 11:29:33 EST Date: Fri, 06 Dec 2019 16:13:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1575648792; bh=z5ckHnM1JT0bjLvn3hu4ZpaORLMeQ8ST4azSjqKt/OI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=LBJvUu/rQZkFQkYxEnV1DHmyjivJCcrljuT6+EmK6y1juedk/dCQonL5Z22l5fmRh 5GgA7lg5FL7hpb+KuTpYPzxna6usQ0kC1uruq2SLXjQuLRezWJ7WkpBWU5W+CyCF5E MN6S0Ndur6pvnTwJ3yKsFbWEPr1hGRWDOAvGOQFI= To: Peter Zijlstra From: Krzysztof Piecuch Cc: "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "viresh.kumar@linaro.org" , "rafael.j.wysocki@intel.com" , "drake@endlessm.com" , "malat@debian.org" , "juri.lelli@redhat.com" Reply-To: Krzysztof Piecuch Subject: Re: [PATCH] x86/tsc: Don't use cpuid 0x16 leaf to determine cpu speed. Message-ID: In-Reply-To: <20191206103942.GE2844@hirez.programming.kicks-ass.net> References: <20191206103942.GE2844@hirez.programming.kicks-ass.net> Feedback-ID: krphKiiPlx_XKIryTSpdJ_XtBwogkHXWA-Us-PsTeaBSrzOTAKWxwbFkseT4Z85b_7PMRvSnq3Ah7f9INXrOMw==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your reply. I experience 2% tsc clock-drift (671s ahead of my local NTP server after 9.= 5h) on my machine with Supermicro's Hyperspeed turned on. There's no clock drift when I turn Hyperspeed off. As far as I know Hyperspeed increases base clock frequency[1]. That's what CPUID says about my overclocked Intel Xeon Gold 6146: Time Stamp Counter/Core Crystal Clock Information (0x15): TSC/clock ratio =3D 256/2 nominal core crystal clock =3D 0 Hz Processor Frequency Information (0x16): Core Base Frequency (MHz) =3D 0xc80 (3200) Core Maximum Frequency (MHz) =3D 0x1068 (4200) Bus (Reference) Frequency (MHz) =3D 0x64 (100) tsc_refine_calibration_work never corrects the early calibration because it calculates a tsc frequency beyond 1% tolerance. I've bumped the tsc_refine_calibration_work's tolerance to 3% and made it w= ork: Hyperspeed: [ 8.571471] tsc: Refined TSC clocksource calibration: 3264.012 MHz No hyperspeed: [ 8.506009] tsc: Refined TSC clocksource calibration: 3200.013 MHz Increasing the tolerance to 3% would work in my case but apparently some servers can increase the base-clock frequency to 6%. [2] At this point in order to completely eliminate this bug we would need to significantly increase the tolerance which might introduce other bugs. [1]: https://www.supermicro.com/support/faqs/faq.cfm?faq=3D21337 [2]: https://www.servethehome.com/supermicro-hyper-speed-server-overclockin= g-bios/ Kind regards, Krzysztof Piecuch