From patchwork Thu May 4 22:13:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13231880 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 1039FC77B7C for ; Thu, 4 May 2023 22:16:14 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hd44OiQoQI8Rexs/DTwCnaVfkjoeFn9EEcbPt749Dpc=; b=mdvwjCPBlBo2c2 lH8K7kisIMbrs1NDdHstRNsvFzECLGoufwwrEfYDMn0Ilcqe8qQoG57fmJDZPN0S7DMledC4NmYdp g1o4HFzSqJobwMj3Erdsgim4sMuYNMnF2FE7Hkjvcz5WzRat05Ewre4B/QjGDahDbcec0J0Vu7+6s G5Ft82eTd6N+NZq1GobQ7/58SqRIGikknvCJjy/1kQ4I+WqnUk9YJFX6KFVhwKmeo3p24XAf0tvRK abX0/pxOLofmwu0L7aonyN8/G5tG+Kk2edo2kSOJj9qK0EFeXN+2UcaW4eOFCEeUFxy/oGLg350G9 NzQTLko7puOJwo60siQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1puhE7-009AUf-2x; Thu, 04 May 2023 22:15:03 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1puhE5-009ASO-0N for linux-arm-kernel@lists.infradead.org; Thu, 04 May 2023 22:15:02 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-64115eef620so15684570b3a.1 for ; Thu, 04 May 2023 15:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683238499; x=1685830499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aOpu4K0AbTK/Q+LJp4KPhDC1e5615vKmnF8Avzjqp1E=; b=AtjVbUDuDhuC3T5VTZajscYw/VEjMbUiZ2X5khp5ctkS+27M1j/InYQ5Dwvm/plnmd krdbBv8nVdEof2X0yL/YrwWPzFZVjFX99rqofGl1oH4jqhbFnFmnoLtQFzOtxTTSUQ8z KlY7Tr7uge6pyOt+bCScYMrb0Elk2S6F8xzAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683238499; x=1685830499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aOpu4K0AbTK/Q+LJp4KPhDC1e5615vKmnF8Avzjqp1E=; b=BFLGIJne+C2EXqt1VQ+d2Vc+Vg+b4em67QheWcRVDEIf5sWM7xTn3UpmKI5FFnUtvn 8heWw0rd7lbaM4yQo6NK3l+VhNJlMKOkIgVpeDodhixFJMsOtwekDWboN7he/Xdb/bjB 4UjFmTs5HE3dxeexAm2eFFdvTQDob2VDF13mENq2yIeuIp6EyM5AVwplWDE15g9vePS0 wGyZs+cZNURpxfgYURv67SmYsLohPLV9VKogo7+OQDjeXpjKDlk6VzvotEq2MxEiew9b Chvr/eNDi6SFcd9+mJDTiwOmsUkG1bcd/52gGHmgf7i7FC7Twyjr83fNa5/tWJYHqb0Q HqGQ== X-Gm-Message-State: AC+VfDwGHXsEdwxEqJn7I1rhIvqRqgpzWnSOyqYFHNAH4VFzB/E5iDGc CuNVX0xS8uAUq5LY0jJ5GvxETg== X-Google-Smtp-Source: ACHHUZ6/nKe5trCUHnOhrXovtrUyQ0CQn+r16BvPpklIKc+6VPGovlM2nNhX9qvrY/8nVCSqNXN/Lw== X-Received: by 2002:a05:6a00:8086:b0:634:c34f:e214 with SMTP id eh6-20020a056a00808600b00634c34fe214mr3971422pfb.10.1683238499411; Thu, 04 May 2023 15:14:59 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:edf0:7321:6b9e:d5e7]) by smtp.gmail.com with ESMTPSA id g26-20020aa7819a000000b006437c0edf9csm169615pfi.16.2023.05.04.15.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 15:14:58 -0700 (PDT) From: Douglas Anderson To: Petr Mladek , Andrew Morton Cc: Sumit Garg , Mark Rutland , Matthias Kaehlcke , Stephane Eranian , Stephen Boyd , ricardo.neri@intel.com, Tzung-Bi Shih , Lecopzer Chen , kgdb-bugreport@lists.sourceforge.net, Masayoshi Mizuma , Guenter Roeck , Pingfan Liu , Andi Kleen , Ian Rogers , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, ito-yuichi@fujitsu.com, Randy Dunlap , Chen-Yu Tsai , christophe.leroy@csgroup.eu, davem@davemloft.net, sparclinux@vger.kernel.org, mpe@ellerman.id.au, Will Deacon , ravi.v.shankar@intel.com, npiggin@gmail.com, linuxppc-dev@lists.ozlabs.org, Marc Zyngier , Catalin Marinas , Daniel Thompson , Douglas Anderson Subject: [PATCH v4 05/17] watchdog/hardlockup: Rename touch_nmi_watchdog() to touch_hardlockup_watchdog() Date: Thu, 4 May 2023 15:13:37 -0700 Message-ID: <20230504151100.v4.5.I4e47cbfa1bb2ebbcdb5ca16817aa2887f15dc82c@changeid> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230504221349.1535669-1-dianders@chromium.org> References: <20230504221349.1535669-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230504_151501_164965_0F445DF2 X-CRM114-Status: GOOD ( 20.15 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In preparation for the buddy hardlockup detector, rename touch_nmi_watchdog() to touch_hardlockup_watchdog() to make it clear that it will touch whatever hardlockup detector is configured. We'll add a #define for the old name (touch_nmi_watchdog) so that we don't have to touch every piece of code referring to the old name. Ideally this change would also rename the arch_touch_nmi_watchdog(), but that is harder since arch_touch_nmi_watchdog() is exported with EXPORT_SYMBOL() and thus is ABI. Add a comment next to the call to hopefully alleviate some of the confusion here. Signed-off-by: Douglas Anderson --- Changes in v4: - ("Rename touch_nmi_watchdog() to ...") new for v4. include/linux/nmi.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 454fe99c4874..35d09d70f394 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -125,18 +125,35 @@ void watchdog_nmi_disable(unsigned int cpu); void lockup_detector_reconfigure(void); /** - * touch_nmi_watchdog - restart NMI watchdog timeout. + * touch_hardlockup_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_hardlockup_watchdog() may be + * used to pet the watchdog (reset the timeout) - for code which + * intentionally disables interrupts for a long time. This call is stateless. */ -static inline void touch_nmi_watchdog(void) +static inline void touch_hardlockup_watchdog(void) { + /* + * Pass on to the hardlockup detector selected via CONFIG_. Note that + * the hardlockup detector may not be arch-specific nor using NMIs, + * but arch_touch_nmi_watchdog() is exported with EXPORT_SYMBOL() and + * is thus ABI. + */ arch_touch_nmi_watchdog(); + + /* + * Touching the hardlock detector implcitily pets the + * softlockup detector too + */ touch_softlockup_watchdog(); } +/* + * It's encouraged for code to refer to the new name, but allow the old + * name as well. + */ +#define touch_nmi_watchdog touch_hardlockup_watchdog + /* * Create trigger_all_cpu_backtrace() out of the arch-provided * base function. Return whether such support was available,