Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp987715rwd; Thu, 8 Jun 2023 10:19:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wR+eDYBqCaWXo+sBV/hUAhU9Zbs3OcCM5sJn/SFnZb/KfaRcvjkXuxBI8WyI0YfY2Esvu X-Received: by 2002:a05:6a20:1e60:b0:10c:f674:3bab with SMTP id cy32-20020a056a201e6000b0010cf6743babmr7275088pzb.61.1686244786173; Thu, 08 Jun 2023 10:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244786; cv=none; d=google.com; s=arc-20160816; b=Q6t8u2k2qxoRABn9wzM1JEmwqLV/4qyOOtPcDc2xhNf/ojkfwW8fOQWu7M2fPgJV36 rTfLYG2pbIbQlK3dqC3lAupHEhkNbA96SFDukCtBpa3h5gKz26ptVwfByEmoz/063fsV iwCruN771+bLzrsPISzbkKDDHDwqgofJYGdeCxdUNXIkEXd/Y1TCI5ycNVKcv5zpbZK+ hIxhrnK4celHp/gz8gC1trAt7gLhyOo8m/hN/jm5++r1T1fenhVVmPLy/MFMPM9BgRa4 ZgBCsapdGqgatvR84CRtbfNWGjuhnXLctqlWwwXtf8cYL2PfJZZAzVTbJ5iG4TQYUcJG vTPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=OxafnrRPLnlRMroroNSUgFcvWKSl7hEH5f70DTDbU14=; b=EXc1UsJxdSh8X095z8FmK0xMWVcj97lHHejE5L2KP14HmDy4HP20c3wfNRpaiLl9pA SZDqf1eBsK0BSFEB+k3En+zhm/+Hi8kuLKkW1bObLAtFYX3A7Po0AudAWpkzA4paIAmv u6CSNFp+0nTzKqTwAdSfVRljKGEfD9R4JUVQZAg8EVnrLWPtMMLyW4+edzqUb8cbOb97 CqdoIpbH6lr/veevjUe85QuD8RG7kNon6GeIeLXebveV/KldhFy+erJGaK9TJG5Ysetp etDsQfkGFXx9Fqo9HL3+Yo6nHSGL8caUECr1JFJKVI2Ot0Vv9Jc1U+gMlEFxXE91rEpJ DYvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FS10IUMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a637312000000b005194eaa611csi1248954pgc.397.2023.06.08.10.19.32; Thu, 08 Jun 2023 10:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FS10IUMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236358AbjFHQ6Q (ORCPT + 99 others); Thu, 8 Jun 2023 12:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236366AbjFHQ6P (ORCPT ); Thu, 8 Jun 2023 12:58:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA6112707 for ; Thu, 8 Jun 2023 09:58:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E03861990 for ; Thu, 8 Jun 2023 16:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAB66C433EF; Thu, 8 Jun 2023 16:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686243492; bh=oj4OkO1uA/76/SEcvbW6HdQWPxsH0HxZxvg2WCw5dks=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=FS10IUMFO/YtyKLse8z3r7zC6RFCM51NhCMcyD48BoYLmDZI4UxMnDePGQ1aWkXOZ XzoExPDiNg8JVM9R/q7kHh2KV1Ta/N3C01zxqm5cIIm6lGeqgesmZbarSHgHzx2mRH Yv1Pvxofj/47HNiWZOehnSpKRGdr4dko0Ywo5/ZTB4cvvN4XCzlR/PZ4htK+iWAZnd uxWhkQasLkxjjbXP4wZHW49Jc45a/soIbPwIe3ni9Vf5TEaAiMUnrIACL2UgbnIb7k AU9jmpiSLkeFbwTCBhygikkyIWbXrEzPN9D1W71S8Fw3HXwo/3/i1NR+fDkCjn6oud xogESA+xsHn5A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5E70ACE14DD; Thu, 8 Jun 2023 09:58:12 -0700 (PDT) Date: Thu, 8 Jun 2023 09:58:12 -0700 From: "Paul E. McKenney" To: Feng Tang Cc: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , rui.zhang@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] x86/tsc: Make recalibration default on for TSC_KNOWN_FREQ cases Message-ID: Reply-To: paulmck@kernel.org References: <20230522033018.1276836-1-feng.tang@intel.com> <87h6s4ye9b.ffs@tglx> <934e9008-36db-492b-b744-9d68183c6d32@paulmck-laptop> <73283eba-14b8-2da1-6109-c183586fe5b7@intel.com> <2c5a8c69-21d0-4b1a-ad1b-6072228e2b43@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 05, 2023 at 09:04:45AM +0800, Feng Tang wrote: > On Fri, Jun 02, 2023 at 12:08:10PM -0700, Paul E. McKenney wrote: > > On Fri, Jun 02, 2023 at 11:36:54AM -0700, Dave Hansen wrote: > > > On 6/2/23 11:29, Paul E. McKenney wrote: > > > >>> One downside is, many VMs also has X86_FEATURE_TSC_KNOWN_FREQ set, > > > >>> and they will also do this recalibration. > > > >> It's also pointless for those SoCs which lack legacy hardware. > > > >> > > > >> So why do you force this on everyone? > > > > Just for the record, this patch could be helpful in allowing victims > > > > of TSC mis-synchronization to more easily provide a more complete bug > > > > report to the firmware people. There is of course no point if there is > > > > already a fix available. > > > > > > > > But it is not all that hard to work around not having this patch upstream. > > > > This can be hand-applied as needed, NTP drift rates can be pressed > > > > into service for those of us having atomic clocks near all our servers, > > > > or the firmware guys can be tasked with figuring it out. > > > > > > > > So this patch would be nice to have, but we could live without it. > > > > > > Is this the kind of thing we could relegate to a kernel unit test? Like > > > make the recalibration logic _available_, but don't have it affect the > > > rest of the system. > > > > > > I love patching my kernel as much as the next guy. But, you know what I > > > *don't* love? Explaining how to patch kernels to other people. ;) > > > > One could argue that we already have the TSC equivalent of a kernel unit > > test with the tsc=recalibrate kernel boot parameter. > > > > So, would it make sense to have something like tsc=recalibrate (already > > present) in the guise of something like hpet=recalibrate and/or > > pmtmr=recalibrate in order to allow people to opt into recalibrating > > whatever timer is marked unstable? > > This kind of hint parsing should be in tsc.c, so some name like > 'tsc_recal=hpet/pmtmr' ? > > As hpet and pmtimer are the only 2 choices and hpet is the default > one, if people want to use pmtimer, they can use combined parameter > "tsc=recalibrate nohpet". Or something like "tsc=recalibrateother"? I am not all that worried about what the boot parameters look like, as long as we have a way of telling the kernel to recalibrate whatever clocksource just got marked unstable. ;-) > Also, thanks for sharing your thoughts form a victim's viewpoint > in the other mail! :) Glad it helped! ;-) Thanx, Paul