Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp61550imm; Tue, 19 Jun 2018 14:19:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhYIzWbNQl4F/0U99Z3n2Ps9k6CsAMyGHYpx1wXbSBj11u+BC/HmKnaxnoMZmBv7KD0JA4 X-Received: by 2002:a62:e506:: with SMTP id n6-v6mr19659602pff.116.1529443163777; Tue, 19 Jun 2018 14:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529443163; cv=none; d=google.com; s=arc-20160816; b=XZD5OOpG45gabCoZdG9XzMbRnklF8kTxWTURnO7Wz5n+sdy2Jy/7jDbju42y8U3fUR yi11JnHepGwHRg/pHvSrN4DAgfLCjG8bu/4pko0MSo+YcprSQJisL2mXtvAVH7174xC8 97S+gZX4mxNb+glYXzijy/8Igu1tkUg1PUcc9Pb8Z30EbgYfZG1WlkRBFmlwZ5e7OW/q F6v+86hbFQEth5Yn0EatSuPve1kzoVd5zvVB76+jtS/VZ7IP8knUWhpbbQe7Rcpq6hV2 Ai/TJYmJRXRxAgMWjs8hhyx7Ev8YChg2zOothbYMik6JOo/fY/VnKrG0xI0ZXlwYwaEN FnZQ== 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:arc-authentication-results; bh=+E/tVinwhnkljTWWVfkd17dRGZK5cOWCzXZMnu/SjAE=; b=oeYGvGsize4zWZiBtitoDvJyDIoKGqckv+1cTjq1pNgO+u4iykvUBNPwv/ptI99V7K CnTzHqOpaHQMKJ8ne7ceoD/CRBFW3RL4WQktbsR3zOdSm/5HO2+6PCbzZv5cfmPT8JGR OBQdjqhbyCt+jquxmT5kibMOFbZNjFEhwpL2u4Mvu+Xx0YD2DMPg4ynNAA39tjN8+DHb HB4YkyiuYiVLcrJl1EgCqmNJ9snL+JDa/MzHbK5s5+3n98E/3e22lVNCFG1lykeR2Lgt sw1sDnazYjpeYe6zkQoZpvYIQQsjhnb+fL+zgOrAdSrUd4Pr6/Shkd8Ck3PR1v0i/hs2 lKVA== 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 s193-v6si491970pgc.372.2018.06.19.14.19.01; Tue, 19 Jun 2018 14:19:23 -0700 (PDT) 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 S1755522AbeFSVQ4 (ORCPT + 99 others); Tue, 19 Jun 2018 17:16:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48740 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755415AbeFSVQv (ORCPT ); Tue, 19 Jun 2018 17:16:51 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5JLEce7038107 for ; Tue, 19 Jun 2018 17:16:51 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jq882ucdb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 19 Jun 2018 17:16:51 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Jun 2018 17:16:50 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 19 Jun 2018 17:16:46 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5JLGj8O11207086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Jun 2018 21:16:46 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31C44B205F; Tue, 19 Jun 2018 17:16:35 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0189EB2064; Tue, 19 Jun 2018 17:16:35 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 19 Jun 2018 17:16:34 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id B3D4116C3BD3; Tue, 19 Jun 2018 14:18:46 -0700 (PDT) Date: Tue, 19 Jun 2018 14:18:46 -0700 From: "Paul E. McKenney" To: Jason Wessel Cc: linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Dipankar Sarma , Ingo Molnar Subject: Re: [RFC PATCH 2/2] rcu,debug_core: allow the kernel debugger to reset the rcu stall timer Reply-To: paulmck@linux.vnet.ibm.com References: <1281330732-17164-1-git-send-email-jason.wessel@windriver.com> <1281330732-17164-2-git-send-email-jason.wessel@windriver.com> <1281330732-17164-3-git-send-email-jason.wessel@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1281330732-17164-3-git-send-email-jason.wessel@windriver.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18061921-0068-0000-0000-0000030B5935 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009222; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01049407; UDB=6.00537710; IPR=6.00828380; MB=3.00021747; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-19 21:16:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18061921-0069-0000-0000-000044BDE2F8 Message-Id: <20180619211846.GO3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-19_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1805220000 definitions=main-1806190228 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 09, 2010 at 12:12:12AM -0500, Jason Wessel wrote: > When returning from the kernel debugger allow a reset of the rcu > jiffies_stall value to prevent the rcu stall detector from sending NMI > events which stack dumps on all the cpus in the system. Not sure where the 2010 date came from, but it almost fooled me into deleting your emails unread. ;-) > Signed-off-by: Jason Wessel > CC: Dipankar Sarma > CC: Paul E. McKenney > CC: Ingo Molnar > --- > include/linux/rcupdate.h | 8 ++++++++ > kernel/debug/debug_core.c | 2 ++ > kernel/rcutree.c | 9 +++++++++ > 3 files changed, 19 insertions(+), 0 deletions(-) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 9fbc54a..abd3ab6 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -599,4 +599,12 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head) > #define rcu_dereference_index_check(p, c) \ > __rcu_dereference_index_check((p), (c)) > > +#ifdef CONFIG_RCU_CPU_STALL_DETECTOR > +extern void rcu_cpu_stall_reset(void); > +#else /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ > +static inline void rcu_cpu_stall_reset(void) > +{ > +} > +#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ > + > #endif /* __LINUX_RCUPDATE_H */ > diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c > index e4d6819..1600e90 100644 > --- a/kernel/debug/debug_core.c > +++ b/kernel/debug/debug_core.c > @@ -47,6 +47,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -474,6 +475,7 @@ static void dbg_touch_watchdogs(void) > { > touch_softlockup_watchdog_sync(); > clocksource_touch_watchdog(); > + rcu_cpu_stall_reset(); > } > > static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) > diff --git a/kernel/rcutree.c b/kernel/rcutree.c > index d5bc439..209b755 100644 > --- a/kernel/rcutree.c > +++ b/kernel/rcutree.c > @@ -532,6 +532,9 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp) > > if (rcu_cpu_stall_panicking) > return; > + /* Gracefully handle a watch dog reset when jiffies_stall == 0 */ > + if (!rsp->jiffies_stall) > + return; Why not just use the existing rcu_cpu_stall_reset()? It sets the next stall a long way into the future, like 2 billion jiffies on 32-bit systems. > delta = jiffies - rsp->jiffies_stall; > rnp = rdp->mynode; > if ((rnp->qsmask & rdp->grpmask) && delta >= 0) { > @@ -561,6 +564,12 @@ static void __init check_cpu_stall_init(void) > atomic_notifier_chain_register(&panic_notifier_list, &rcu_panic_block); > } > > +void rcu_cpu_stall_reset(void) > +{ > + rcu_sched_state.jiffies_stall = 0; > + rcu_bh_state.jiffies_stall = 0; This should get you a compiler warning given the existing rcu_cpu_stall_reset(). It also fails to do anything about rcu_preempt_state on PREEMPT=y kernels. What happens if you just remove the rcutree.c changes from your series and test with the result? Thanx, Paul > +} > + > #else /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ > > static void record_gp_stall_check_time(struct rcu_state *rsp) > -- > 1.6.3.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >