From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72729C7EE2A for ; Tue, 23 May 2023 09:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236336AbjEWJfX (ORCPT ); Tue, 23 May 2023 05:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236326AbjEWJfS (ORCPT ); Tue, 23 May 2023 05:35:18 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2620E138; Tue, 23 May 2023 02:35:14 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id B6BD41FF45; Tue, 23 May 2023 09:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1684834512; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IAYq7YJVS2Hlnl42uVu2goasTRVPRgZ4NqjKSyNxGrQ=; b=KU08sltoiXCpoxueN/xTm1Dj8XgBHSTDWuL90uW147a2/O/Mr6ZoeLyNLFpVJWdIVW5kxX qqA4ifcAtaWSIWN6bnayexKSUglQmxet+EFMnoKUKq4Izsg5nga9Xy+G/qI4h+1EzPAbdY lsmjo1AyUZ4F7lDFhMIZqs6iohgJ0mY= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 46EBC2C141; Tue, 23 May 2023 09:35:07 +0000 (UTC) Date: Tue, 23 May 2023 11:35:02 +0200 From: Petr Mladek To: Douglas Anderson Cc: Andrew Morton , Matthias Kaehlcke , kgdb-bugreport@lists.sourceforge.net, Stephane Eranian , mpe@ellerman.id.au, Tzung-Bi Shih , Daniel Thompson , Mark Rutland , linuxppc-dev@lists.ozlabs.org, Sumit Garg , npiggin@gmail.com, davem@davemloft.net, Marc Zyngier , Stephen Boyd , sparclinux@vger.kernel.org, christophe.leroy@csgroup.eu, Catalin Marinas , ravi.v.shankar@intel.com, Randy Dunlap , Pingfan Liu , Guenter Roeck , Lecopzer Chen , Ian Rogers , ito-yuichi@fujitsu.com, ricardo.neri@intel.com, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, Will Deacon , Chen-Yu Tsai , linux-kernel@vger.kernel.org, Masayoshi Mizuma , Andi Kleen Subject: Re: [PATCH v5 02/18] watchdog/perf: More properly prevent false positives with turbo modes Message-ID: References: <20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid> <20230519101840.v5.2.I843b0d1de3e096ba111a179f3adb16d576bef5c7@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230519101840.v5.2.I843b0d1de3e096ba111a179f3adb16d576bef5c7@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Fri 2023-05-19 10:18:26, Douglas Anderson wrote: > Currently, in the watchdog_overflow_callback() we first check to see > if the watchdog had been touched and _then_ we handle the workaround > for turbo mode. This order should be reversed. > > Specifically, "touching" the hardlockup detector's watchdog should > avoid lockups being detected for one period that should be roughly the > same regardless of whether we're running turbo or not. That means that > we should do the extra accounting for turbo _before_ we look at (and > clear) the global indicating that we've been touched. The ideal solution would be to reset the turbo-mode-related variables when the watchdog is touched. And keep checking watchdog_nmi_touch first. But this ordering change should be good enough. It causes that we always check watchdog_nmi_touch when the turbo-more-related variables are already reset. > NOTE: this fix is made based on code inspection. I am not aware of any > reports where the old code would have generated false positives. That > being said, this order seems more correct and also makes it easier > down the line to share code with the "buddy" hardlockup detector. > > Fixes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes") > Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Best Regards, Petr