Received: by 10.223.176.5 with SMTP id f5csp136162wra; Tue, 6 Feb 2018 18:54:44 -0800 (PST) X-Google-Smtp-Source: AH8x224dSrF5CBE8yzoFLjjf5iA0na3KzMPEAalwhEYzfL8pFO5QRySkg8DocfoybtF5AeApMC2M X-Received: by 10.101.64.67 with SMTP id h3mr3605135pgp.168.1517972084375; Tue, 06 Feb 2018 18:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517972084; cv=none; d=google.com; s=arc-20160816; b=pFe1xO7tdssi4EH1hAaoXi/U2LsEGlV9XKApFPNbS3FpUf/Tn4VQz+5D/VrfgUMOAg WF+KBn14jCZCW3yMUHDSx2iEmnKMofPzXGQwhMF5GTW6TniC6GqP/EMkbvixZhq8jmpf 19RKIzb1+4XcF0OpSOzQ+NuuxvMiw95zD8K3t3nA5RIHeRlw5QZ1vbTLb5enRfKxnytK XIQN9HZ/No6Et66CZ22jO0QwtHzSxZYICnnkDms/t1O1k3nIJlSP7Le0WxLYzCC7et43 j0FEVqy5OZMIoTyKETDTHbArrjmdv9WYyCJKCAM8Ws2c+6YU21UTMu/9LxlWVzSSkOTN xDag== 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=uWrTkUqXRTr7oPQK0sBX+Wmd+pAwULBUhVc0rJu7Eww=; b=L0ILmx1j7f7ZIsAsK8Ojk2hKN0tL4+Xfp31V3E4B92jYDXIYFcXwvzAeymaDXqngmt qlBDwMT1cuKwNjudhOw6nAgw717bi65DkDRLraefb39D3qO+jr/WTHFL35cREwg3m9X0 mzAbzibAd1eYJSWzCp8gwHzv1DoOpylJwSbd5+UhKZuzpL/kq407nwRcQSo2Oyts7Tuz MfT7YcjJUDFkTyTpDJRQmOIi+zpAA36W+QCtgDx39ikDjLm/HhPuqkaAwTjEI6MCXNT6 PpOHB8fgZUIR90t/E8H0TTgh8fWJkQ8SX1ZpTopTeda3D9WxICdBt1OAmYhKDDV9Z3fk MOSw== 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 r2si309720pgv.485.2018.02.06.18.54.30; Tue, 06 Feb 2018 18:54:44 -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 S1753081AbeBGCxc (ORCPT + 99 others); Tue, 6 Feb 2018 21:53:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38466 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752732AbeBGCxb (ORCPT ); Tue, 6 Feb 2018 21:53:31 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w172nPxY090121 for ; Tue, 6 Feb 2018 21:53:31 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fykvju8a3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Feb 2018 21:53:30 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Feb 2018 21:53:30 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Feb 2018 21:53:26 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w172rQEn48234746; Wed, 7 Feb 2018 02:53:26 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E62CB204D; Tue, 6 Feb 2018 21:50:21 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.124.35.70]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 4ED6AB2058; Tue, 6 Feb 2018 21:50:21 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 40F4916C6240; Tue, 6 Feb 2018 18:53:37 -0800 (PST) Date: Tue, 6 Feb 2018 18:53:37 -0800 From: "Paul E. McKenney" To: "Serge E. Hallyn" Cc: Tejun Heo , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: Can RCU stall lead to hard lockups? Reply-To: paulmck@linux.vnet.ibm.com References: <20180109035207.GD3668920@devbig577.frc2.facebook.com> <20180109042425.GS9671@linux.vnet.ibm.com> <20180109141114.GF3668920@devbig577.frc2.facebook.com> <20180109152234.GU9671@linux.vnet.ibm.com> <20180202234430.GA25611@mail.hallyn.com> <20180203205032.GN3617@linux.vnet.ibm.com> <20180207023303.GA10583@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207023303.GA10583@mail.hallyn.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18020702-0044-0000-0000-000003DCBF63 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008488; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00986038; UDB=6.00500373; IPR=6.00765405; BA=6.00005813; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019412; XFM=3.00000015; UTC=2018-02-07 02:53:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020702-0045-0000-0000-0000080C2F23 Message-Id: <20180207025337.GD3617@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-07_01:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802070030 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 06, 2018 at 08:33:03PM -0600, Serge E. Hallyn wrote: > On Sat, Feb 03, 2018 at 12:50:32PM -0800, Paul E. McKenney wrote: > > On Fri, Feb 02, 2018 at 05:44:30PM -0600, Serge E. Hallyn wrote: > > > Quoting Paul E. McKenney (paulmck@linux.vnet.ibm.com): > > > > On Tue, Jan 09, 2018 at 06:11:14AM -0800, Tejun Heo wrote: > > > > > Hello, Paul. > > > > > > > > > > On Mon, Jan 08, 2018 at 08:24:25PM -0800, Paul E. McKenney wrote: > > > > > > > I don't know the RCU code at all but it *looks* like the first CPU is > > > > > > > taking a sweet while flushing printk buffer while holding a lock (the > > > > > > > console is IPMI serial console, which faithfully emulates 115200 baud > > > > > > > rate), and everyone else seems stuck waiting for that spinlock in > > > > > > > rcu_check_callbacks(). > > > > > > > > > > > > > > Does this sound possible? > > > > > > > > > > > > 115200 baud? Ouch!!! That -will- result in trouble from console > > > > > > printing, and often also in RCU CPU stall warnings. > > > > > > > > > > It could even be slower than 115200, and we occassionally see RCU > > > > > stall warnings caused by printk storms, for example, while the kernel > > > > > is trying to dump a lot of info after an OOM. That's an issue we > > > > > probably want to improve from printk side; however, they don't usually > > > > > lead to NMI hard lockup detector kicking in and crashing the machine, > > > > > which is the peculiarity here. > > > > > > > > > > Hmmm... show_state_filter(), the function which dumps all task > > > > > backtraces, share a similar problem and it avoids it by explicitly > > > > > calling touch_nmi_watchdog(). Maybe we can do something like the > > > > > following from RCU too? > > > > > > > > If this fixes things for you, I would welcome such a patch. > > > > > > Hi - would this also be relevant to 4.9-stable and 4.4-stable, or > > > has something elsewhere changed after 4.9 that actually triggers this? > > > > As far as I can tell, slow console lines have been prone to RCU CPU stall > > warnings for a very long time. > > Ok, thanks Paul. > > Tejun were you going to push this? I have it queued for the next merge window. 3eea9623926f ("rcu: Call touch_nmi_watchdog() while printing stall warnings") in -rcu. Thanx, Paul > > > thanks, > > > -serge > > > > > > > Thanx, Paul > > > > > > > > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > > > > > index db85ca3..3c4c4d3 100644 > > > > > --- a/kernel/rcu/tree_plugin.h > > > > > +++ b/kernel/rcu/tree_plugin.h > > > > > @@ -561,8 +561,14 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp) > > > > > } > > > > > t = list_entry(rnp->gp_tasks->prev, > > > > > struct task_struct, rcu_node_entry); > > > > > - list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) > > > > > + list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) { > > > > > + touch_nmi_watchdog(); > > > > > + /* > > > > > + * We could be printing a lot of these messages while > > > > > + * holding a spinlock. Avoid triggering hard lockup. > > > > > + */ > > > > > sched_show_task(t); > > > > > + } > > > > > raw_spin_unlock_irqrestore_rcu_node(rnp, flags); > > > > > } > > > > > > > > > > @@ -1678,6 +1684,12 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu) > > > > > char *ticks_title; > > > > > unsigned long ticks_value; > > > > > > > > > > + /* > > > > > + * We could be printing a lot of these messages while holding a > > > > > + * spinlock. Avoid triggering hard lockup. > > > > > + */ > > > > > + touch_nmi_watchdog(); > > > > > + > > > > > if (rsp->gpnum == rdp->gpnum) { > > > > > ticks_title = "ticks this GP"; > > > > > ticks_value = rdp->ticks_this_gp; > > > > > > > > >