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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80F82C77B75 for ; Tue, 23 May 2023 09:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BY00WmsD8LEcG/H8qkAu7dDBF1/6HgdxkOJ3Z5WnyF8=; b=21kcAO88vQGhCY KEcptmWs5cy6d2qgUnuUMmfJytGHFhVr0Lsdo61zWkv54j3z9qtjKcKlL6ojeHTkQc/fbzLR8I7vP losrQTfTp302m2AIuqqEE0GSiras+lNQxuKfG+OG9OKgfLC7XHbQmehit4fCBtYy2GuOvJTFfdzj1 6dR6bVT/hAYQyQQujMw+aq5nIKq8sIIePsu9qrjnHvAbSpS6FT9h8InUC51Ls8u0d6rCxzjq5xrmR /fjiZvFLA7eEN286lwMVGJA9RsC0zRKho9RHKMXuocn0Iz14iKf8PXlsqbPNb8O6LnXrX//mbCWPj lRvcZfMxlFumwPTYdwdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1Omb-009hWs-09; Tue, 23 May 2023 09:58:21 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1OmX-009hVa-0t for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 09:58:19 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id ABFEE228CB; Tue, 23 May 2023 09:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1684835895; 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=nijlHHOQkzUZvFPKISvsuCEtH+liiy/rrVmusLy93j8=; b=ukTNS+LA6LnEMXgs7TAWMh1IEmoqBA7OQZDzqQXjQCWc5jDXPfiss/BRVs+P68hkc1jpJr c6osfgyH7PPHg1SaA9cUw8ILMGtVpU6UYgIiSt2i5Y85hLTxvlKanmjx7xXSsVqooWm2a+ O77Wy9lZcLNnFK6dGprQMn1Tn2HdM8E= 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 305BA2C141; Tue, 23 May 2023 09:58:14 +0000 (UTC) Date: Tue, 23 May 2023 11:58:13 +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 06/18] watchdog/hardlockup: Add comments to touch_nmi_watchdog() Message-ID: References: <20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid> <20230519101840.v5.6.I4e47cbfa1bb2ebbcdb5ca16817aa2887f15dc82c@changeid> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230519101840.v5.6.I4e47cbfa1bb2ebbcdb5ca16817aa2887f15dc82c@changeid> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230523_025817_466064_817E0FE9 X-CRM114-Status: GOOD ( 31.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri 2023-05-19 10:18:30, Douglas Anderson wrote: > In preparation for the buddy hardlockup detector, add comments to > touch_nmi_watchdog() to make it obvious that it touches the configured > hardlockup detector regardless of whether it's backed by an NMI. Also > note that arch_touch_nmi_watchdog() may not be architecture-specific. > > Ideally, we'd like to rename these functions but that is a fairly > disruptive change touching a lot of drivers. After discussion [1] the > plan is to defer this until a good time. > > [1] https://lore.kernel.org/r/ZFy0TX1tfhlH8gxj@alley > > Signed-off-by: Douglas Anderson > --- > > Changes in v5: > - No longer rename touch_nmi_watchdog(), just add comments. > > Changes in v4: > - ("Rename touch_nmi_watchdog() to ...") new for v4. > > include/linux/nmi.h | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > > diff --git a/include/linux/nmi.h b/include/linux/nmi.h > index 454fe99c4874..fafab128f37e 100644 > --- a/include/linux/nmi.h > +++ b/include/linux/nmi.h > @@ -125,15 +125,30 @@ void watchdog_nmi_disable(unsigned int cpu); > void lockup_detector_reconfigure(void); > > /** > - * touch_nmi_watchdog - restart NMI watchdog timeout. > + * touch_nmi_watchdog - manually pet the hardlockup watchdog. > * > - * If the architecture supports the NMI watchdog, touch_nmi_watchdog() > - * may be used to reset the timeout - for code which intentionally > - * disables interrupts for a long time. This call is stateless. > + * If we support detecting hardlockups, touch_nmi_watchdog() may be > + * used to pet the watchdog (reset the timeout) - for code which Nit: I personally prefer "reset the timeout" over "pet the watchdog". "pet" is just another ambiguous name as "touch" ;-) > + * intentionally disables interrupts for a long time. This call is stateless. > + * > + * Though this function has "nmi" in the name, the hardlockup watchdog might > + * not be backed by NMIs. This function will likely be renamed to > + * touch_hardlockup_watchdog() in the future. > */ > static inline void touch_nmi_watchdog(void) > { > + /* > + * Pass on to the hardlockup detector selected via CONFIG_. Note that > + * the hardlockup detector may not be arch-specific nor using NMIs > + * and the arch_touch_nmi_watchdog() function will likely be renamed > + * in the future. > + */ > arch_touch_nmi_watchdog(); > + > + /* > + * Touching the hardlock detector implcitily pets the > + * softlockup detector too > + */ s/implcitily/implicitly/ That said, I would remove this comment completely. It describes what is clear from the code. A more useful information would be why it is done. But it is probably clear as well. CPU could not schedule when interrupts are disabled. > touch_softlockup_watchdog(); > } With the removed comment above touch_softlockup_watchdog(): Reviewed-by: Petr Mladek Best Regards, Petr _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel