Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4456358rwb; Mon, 21 Nov 2022 07:49:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf76wSDdN7MqIs2YiBFzDOlVtgijgc+nfTzKUeuoLgd7svysEtdGOysujB2Zmowl6UbPsAd3 X-Received: by 2002:a17:906:a148:b0:7ad:b286:8ee2 with SMTP id bu8-20020a170906a14800b007adb2868ee2mr15854009ejb.511.1669045774171; Mon, 21 Nov 2022 07:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669045774; cv=none; d=google.com; s=arc-20160816; b=Jvu3ntbsc/IADXgE72tOVBlU4YHNmwYQ+WkAzkpKisFGQT29iryRKtTRYB5lxdd8yk tvkHtC0zUuVxUEJxrCFIRFf1sGxFNdSDPsB+o9vv4la0bNPzjrte5XUenteux0hvxaYP fe8DAZP0fNSTlgIxNhsmAEJle3eDgp+9RtrYCqz9nr0nAEmQSD/Hz4xlaJsQ5D+yXILt w4msQaFY4/0Ia6QaSzAFg8JGn0N1jjdL1lBBbtYII8xafJi1Hrd/6MbP2yT4C2qA0Xua YI9DBXDf3JGKVMHoPo4LUuKQtyYJiCc4fCZp51KlXtAjkqLTufSwjQEqo+vIkByOLskd ZCYA== 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=FCOqGZkBoVS4iUdutOVsf3QnaNYE9ZKjleCcmrLUhfk=; b=OiDaUDY33rQpeaVn3U/VTbYosjcCucyqpNpowkdYOq2441M3pmxtXWxIbAsLfUfrkq 1sW82bhbpZTqApEHYm5paRdcjFlAbCv6h7uvlR9ynUYKoNFpqHBqaMtwtgXSCiIPMBOT Xpvq0V9oQPjXnf4rxF+epTbXxtZdN1RLTxeReUy/aI5SqGlTb2Lh5CBbI0nVyBaQuOeB qyCLUy0ILmFwiTbH02J8BPqNNQYMGCTE5aPqnvnwUckoWsutS83k3wgryXhaLYm+xHVg WzbQvxpwgEOv66JpYjS0BG1aIF2TYbuY3YjS93GaGn0o71WSa81DLq0E0rRbOkYmb0Su GcIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HnB3Tf4I; 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 k17-20020a170906681100b0078a3ef9f092si7930336ejr.998.2022.11.21.07.48.55; Mon, 21 Nov 2022 07:49:34 -0800 (PST) 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=HnB3Tf4I; 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 S231618AbiKUPWW (ORCPT + 91 others); Mon, 21 Nov 2022 10:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbiKUPV7 (ORCPT ); Mon, 21 Nov 2022 10:21:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D98817056 for ; Mon, 21 Nov 2022 07:21:09 -0800 (PST) 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 9B4E8612D2 for ; Mon, 21 Nov 2022 15:21:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1C42C433D6; Mon, 21 Nov 2022 15:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669044068; bh=7atMFS0RY0Y/N7XUzTTJuXzocBWr2wWTxt267FH+3DI=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=HnB3Tf4Idvo2yTv2MbHMbHDj3aHypDeuBOuDJ5xK8bFFkyKxlP9tQCLOh/0yDG0hp 8HSFNsAT/tRtAB9J8gevCqbjDtO8CgzIB8W6S9iESZExOSj7EnwdVUXdsk7sIAEB3N nE0EmiiChIlAbvnAOrTB6GeLgKqV/9ErWIiEzqtsB6I/E1g873vuxlr82JZqqctVpo l9MyhstIKDG33MroHwZ8iSAfeFz0ktRQS8PhTUHWUjAEInIPOG9wtFsohwIhYLHfEP ZBbNsdaRcb0zE7PcP1VQGyzrbKYunxKxWj+KWSjmu7h89CiFOCP1ZqKoXm3aZuBto7 LFxAdEGrqAEIw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 96D825C0292; Mon, 21 Nov 2022 07:21:07 -0800 (PST) Date: Mon, 21 Nov 2022 07:21:07 -0800 From: "Paul E. McKenney" To: Feng Tang Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, john.stultz@linaro.org, sboyd@kernel.org, corbet@lwn.net, Mark.Rutland@arm.com, maz@kernel.org, kernel-team@meta.com, neeraju@codeaurora.org, ak@linux.intel.com, zhengjun.xing@intel.com, Chris Mason , John Stultz , Waiman Long Subject: Re: [PATCH clocksource 1/3] clocksource: Reject bogus watchdog clocksource measurements Message-ID: <20221121152107.GI4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221114232807.GA834337@paulmck-ThinkPad-P17-Gen-1> <20221114232827.835599-1-paulmck@kernel.org> <87mt8pkzw1.ffs@tglx> <20221117230910.GI4001@paulmck-ThinkPad-P17-Gen-1> 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 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, Nov 21, 2022 at 08:55:15AM +0800, Feng Tang wrote: > On Thu, Nov 17, 2022 at 03:09:10PM -0800, Paul E. McKenney wrote: > > On Thu, Nov 17, 2022 at 10:57:34PM +0100, Thomas Gleixner wrote: > > > Paul! > > > > > > On Mon, Nov 14 2022 at 15:28, Paul E. McKenney wrote: > > > > > > > > + /* Check for bogus measurements. */ > > > > + wdi = jiffies_to_nsecs(WATCHDOG_INTERVAL); > > > > + if (wd_nsec < (wdi >> 2)) { > > > > + pr_warn("timekeeping watchdog on CPU%d: Watchdog clocksource '%s' advanced only %lld ns during %d-jiffy time interval, skipping watchdog check.\n", smp_processor_id(), watchdog->name, wd_nsec, WATCHDOG_INTERVAL); > > > > + continue; > > > > + } > > > > + if (wd_nsec > (wdi << 2)) { > > > > + pr_warn("timekeeping watchdog on CPU%d: Watchdog clocksource '%s' advanced an excessive %lld ns during %d-jiffy time interval, probable CPU overutilization, skipping watchdog check.\n", smp_processor_id(), watchdog->name, wd_nsec, WATCHDOG_INTERVAL); > > > > + continue; > > > > + } > > > > > > This is really getting ridiculous. > > > > I have absolutely no argument with this statement, and going back a > > long time. ;-) > > > > But the set of systems that caused me to send this turned out to have > > real divergence between HPET and TSC, and 40 milliseconds per second of > > divergence at that. So not only do you hate this series, but it is also > > the case that this series doesn't help with the problem at hand. > > The drift is about 4% which is quite big. It seems that this is > either problem of HPET/TSC's hardware/firmware, or the problem of > frequency calibration for HPET/TSC. TSC calibration is complex, > as it could be done from different methods depending on hardware > and firmware, could you share the kernel boot log related with > tsc/hpet and clocksource? Thank you for looking into this! Knucklehead here failed to save away the dmesg. Let me see what I can drum up. > Also if your platform has acpi PM_TIMER, you may try "nohpet" > to use PM_TIMER instead of HPET and check if there is also big > drift between TSC and PM_TIMER. Let me see about giving this a go, and again, thank you! Thanx, Paul