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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A0DFC43381 for ; Wed, 27 Feb 2019 16:18:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B41121850 for ; Wed, 27 Feb 2019 16:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730037AbfB0QSP (ORCPT ); Wed, 27 Feb 2019 11:18:15 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39276 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728189AbfB0QSO (ORCPT ); Wed, 27 Feb 2019 11:18:14 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1RGEmS5040899 for ; Wed, 27 Feb 2019 11:18:13 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qwuva7gkx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Feb 2019 11:18:12 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Feb 2019 16:18:11 -0000 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Feb 2019 16:18:01 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1RGHxB38978600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Feb 2019 16:17:59 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 644DCB2065; Wed, 27 Feb 2019 16:17:59 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17D80B205F; Wed, 27 Feb 2019 16:17:59 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.188]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 27 Feb 2019 16:17:59 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id D4F6616C42A7; Wed, 27 Feb 2019 08:17:58 -0800 (PST) Date: Wed, 27 Feb 2019 08:17:58 -0800 From: "Paul E. McKenney" To: Ricardo Neri Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Ashok Raj , Andi Kleen , Peter Zijlstra , "Ravi V. Shankar" , x86@kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , "H. Peter Anvin" , Tony Luck , "Rafael J. Wysocki" , Don Zickus , Nicholas Piggin , Michael Ellerman , Frederic Weisbecker , Alexei Starovoitov , Babu Moger , "David S. Miller" , Benjamin Herrenschmidt , Paul Mackerras , Mathieu Desnoyers , Masami Hiramatsu , Andrew Morton , Philippe Ombredanne , Colin Ian King , Byungchul Park , "Luis R. Rodriguez" , Waiman Long , Josh Poimboeuf , Randy Dunlap , Davidlohr Bueso , Christoffer Dall , Marc Zyngier , Kai-Heng Feng , Konrad Rzeszutek Wilk , David Rientjes , sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH v2 09/14] watchdog/hardlockup: Make arch_touch_nmi_watchdog() to hpet-based implementation Reply-To: paulmck@linux.ibm.com References: <1551283518-18922-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1551283518-18922-10-git-send-email-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551283518-18922-10-git-send-email-ricardo.neri-calderon@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19022716-0040-0000-0000-000004C8DD4C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010674; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000281; SDB=6.01167172; UDB=6.00606765; IPR=6.00947783; MB=3.00025768; MTD=3.00000008; XFM=3.00000015; UTC=2019-02-27 16:18:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19022716-0041-0000-0000-000008D3E51E Message-Id: <20190227161758.GE4072@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-27_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902270110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 27, 2019 at 08:05:13AM -0800, Ricardo Neri wrote: > CPU architectures that have an NMI watchdog use arch_touch_nmi_watchdog() > to briefly ignore the hardlockup detector. If the architecture does not > have an NMI watchdog, one can be constructed using a source of non- > maskable interrupts. In this case, arch_touch_nmi_watchdog() is common > to any underlying hardware resource used to drive the detector and needs > to be available to other kernel subsystems if hardware different from perf > drives the detector. > > There exists perf-based and HPET-based implementations. Make it available > to the latter. > > For clarity, wrap this function in a separate preprocessor conditional > from functions which are truly specific to the perf-based implementation. > > Cc: "H. Peter Anvin" > Cc: Ashok Raj > Cc: Andi Kleen > Cc: Tony Luck > Cc: "Rafael J. Wysocki" > Cc: Don Zickus > Cc: Nicholas Piggin > Cc: Michael Ellerman > Cc: Frederic Weisbecker > Cc: Alexei Starovoitov > Cc: Babu Moger > Cc: "David S. Miller" > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Mathieu Desnoyers > Cc: Masami Hiramatsu > Cc: Peter Zijlstra > Cc: Andrew Morton > Cc: Philippe Ombredanne > Cc: Colin Ian King > Cc: Byungchul Park > Cc: "Paul E. McKenney" > Cc: "Luis R. Rodriguez" > Cc: Waiman Long > Cc: Josh Poimboeuf > Cc: Randy Dunlap > Cc: Davidlohr Bueso > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Kai-Heng Feng > Cc: Konrad Rzeszutek Wilk > Cc: David Rientjes > Cc: "Ravi V. Shankar" > Cc: x86@kernel.org > Cc: sparclinux@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Ricardo Neri > --- > include/linux/nmi.h | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/include/linux/nmi.h b/include/linux/nmi.h > index 5a8b19749769..bf5ebcfdd590 100644 > --- a/include/linux/nmi.h > +++ b/include/linux/nmi.h > @@ -94,8 +94,16 @@ static inline void hardlockup_detector_disable(void) {} > # define NMI_WATCHDOG_SYSCTL_PERM 0444 > #endif > > -#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) > +#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) || \ > + defined(CONFIG_X86_HARDLOCKUP_DETECTOR_HPET) Why not instead make CONFIG_X86_HARDLOCKUP_DETECTOR_HPET select CONFIG_HARDLOCKUP_DETECTOR_PERF? Keep the arch-specific details in the arch-specific files and all that. Thanx, Paul > extern void arch_touch_nmi_watchdog(void); > +#else > +# if !defined(CONFIG_HAVE_NMI_WATCHDOG) > +static inline void arch_touch_nmi_watchdog(void) {} > +# endif > +#endif > + > +#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) > extern void hardlockup_detector_perf_stop(void); > extern void hardlockup_detector_perf_restart(void); > extern void hardlockup_detector_perf_disable(void); > -- > 2.17.1 >