Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1961065img; Wed, 27 Feb 2019 08:19:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IZIM1zqPTzhhrv6Pd3MVQaK4fvGHKUOKa1PspV1TeGh6YV4opInYb4SGaqFENZK36aGft07 X-Received: by 2002:a63:6cc8:: with SMTP id h191mr3569423pgc.366.1551284362518; Wed, 27 Feb 2019 08:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551284362; cv=none; d=google.com; s=arc-20160816; b=F4mjubigyhwaOMFJMLu3OLIJRGUxuremt96EXTl2JNf1vLJCePvW32otZg5/2lbAi8 awjjNTwVN72qLB06hPiotxqB81iRT6Av26Q642US2omo946QXDd+HrqdbUV4jxXMAg2I j2VGuynYhUBWqULTdYm41sDkl3OskpoARiz6k1JOAMUrPqRguqZZKNk2b0tDhY1gbXTP 50pU6tIjh20lZCA2hP1rE730TWZWxMuKBbzQ95a9V4U2hxvE8cDmalGp8PhKTOQbJsBw r8PrE29w6zngmK4r9BgCCR5g20Xhv/sGQbyfjvlzS5opflvsYWqOcNJwAzdVKvdPn3Ri SfvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=/ybai7m3TU+AWt+FDUYEtaCGsMY9aO8hVoRubGP/+8k=; b=LzzF5e7QMMpxAEsjzm1/KdJm7+7An5eqpikBo453gkImjS6cYc08otHYIYnI4LjPNN 0SkJT/8DJn3B6VlLmgsWEvC1hney49OpIYcVnoqvExpJISX+Q/uEG4MOINnt/RsMVLJ+ mWAHQ8uBukg7PvlLKz1PCSaWUaNdiMBFet9+p/ud5gAzUs7/eWGaZOo0uuZUs/NOqN/V KYLtrewlHLHP8hgT+B01P3w85aTAbxghTop2Qgv5PkgRnmgfv9R+2EM7T3Tq0XbCs9+i RZmsQgEdp1JaSN7o6zA52vn4LHejo/InbNcv2+1UK8WArwsAvfKLWfvXdILabfy/QGMB T4/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si14998239pge.451.2019.02.27.08.19.05; Wed, 27 Feb 2019 08:19:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729858AbfB0QSP (ORCPT + 99 others); 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 >