Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp268936imu; Wed, 12 Dec 2018 16:34:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/VMRhHo9qHVfekejgKI3gfM6+LVPawlvMV+Dh56BnE2MnTwQXRB0PjSfdyZA0aEanvpv0da X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr21264801plr.207.1544661268054; Wed, 12 Dec 2018 16:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544661268; cv=none; d=google.com; s=arc-20160816; b=S6faMr4Zgc+j4hEMBUEuo5fW7BIv0Gi61PkZ0+EYe/7iC1TY33jShC2CVPIrtbE+n8 QNfUOW3BxCh9EAu/y2ckJkLFf0Fs2AfRnoHce/NZVZ2eRaXRGo8vfjBQ49R1f0ptYXSp A8FSwY22D0ECffYV/2CxINJZRN6Lc6urSz7pMQmSr7WEUzeNsato2i92SgCHrStmElxg SvagymYfq9FdtjqfKT0SxvqCfKbZjYZguOzw7wf8spEnF48s7Yy/cpaJXzu5Ub+WF5kp 0ErRDTVNamYTDy0xg1pTD3/6U+cDbSSjU8vnIEGXGkuMnOr04aMHScYPyhnFohhAHAxL wdoA== 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=Tulg+SjKkBORDhNP5W6LoVvZTj5HLXj68K3rYs97pqg=; b=DxY7I4w0DUtCka8X+HJwA+yTqol+0xkNMea8rXz1fn2zIc47PEh7lE78qsuB4/yozx +L4J9+Zudk95Zd4I6vBfN9QF/LuaI3gX7jvHaV5QgjkCStVji5DpKZ+yrdn5Ltf3oRIs OMgBWLL1YyJb1raJcnLST5dWe32pSR8cc2l4Q0ppQqQAon4Cqq7s93ngN1L6eeVrF3Wq YpTVOuW64kjkSrMlgb7JkOaMzvRIoyhatH/+JSaZehgY5JqYnd5odZUm/n+y6gXNWsa6 aZuOY51KM+UM2FIb+2LBYFWjFaiipmW9gZ/MWvYqQuoOkJEtoJu2nq+IyHUKeI6RUpgH aN9g== 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 n11si228446pgj.373.2018.12.12.16.34.13; Wed, 12 Dec 2018 16:34:28 -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 S1728530AbeLMAdP (ORCPT + 99 others); Wed, 12 Dec 2018 19:33:15 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59052 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbeLMAdO (ORCPT ); Wed, 12 Dec 2018 19:33:14 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBD04Fju115480 for ; Wed, 12 Dec 2018 19:12:20 -0500 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pb9fe8auk-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Dec 2018 19:12:19 -0500 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Dec 2018 00:12:18 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 13 Dec 2018 00:12:15 -0000 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 wBD0CE8B18415862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Dec 2018 00:12:14 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04506B206A; Thu, 13 Dec 2018 00:12:14 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFD00B2065; Thu, 13 Dec 2018 00:12:13 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.38]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 13 Dec 2018 00:12:13 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E2E2816C5F33; Wed, 12 Dec 2018 16:12:14 -0800 (PST) Date: Wed, 12 Dec 2018 16:12:14 -0800 From: "Paul E. McKenney" To: "He, Bo" Cc: Steven Rostedt , "linux-kernel@vger.kernel.org" , "josh@joshtriplett.org" , "mathieu.desnoyers@efficios.com" , "jiangshanlai@gmail.com" , "Zhang, Jun" , "Xiao, Jin" , "Zhang, Yanmin" , "Bai, Jie A" , "Sun, Yi J" Subject: Re: rcu_preempt caused oom Reply-To: paulmck@linux.ibm.com References: <20181209195601.GA7854@linux.ibm.com> <20181211003838.GD4170@linux.ibm.com> <20181211044631.GA19942@linux.ibm.com> <20181212022446.GV4170@linux.ibm.com> <20181212154224.GX4170@linux.ibm.com> <20181212210316.GA14777@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18121300-0052-0000-0000-00000366429B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010216; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01130911; UDB=6.00587690; IPR=6.00911045; MB=3.00024673; MTD=3.00000008; XFM=3.00000015; UTC=2018-12-13 00:12:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18121300-0053-0000-0000-00005F15680F Message-Id: <20181213001214.GE4170@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-12_04:,, 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-1812120202 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 11:13:22PM +0000, He, Bo wrote: > I don't see the rcutree.sysrq_rcu parameter in v4.19 kernel, I also checked the latest kernel and the latest tag v4.20-rc6, not see the sysrq_rcu. > Please correct me if I have something wrong. That would be because I sent you the wrong patch, apologies! :-/ Please instead see the one below, which does add sysrq_rcu. Thanx, Paul > -----Original Message----- > From: Paul E. McKenney > Sent: Thursday, December 13, 2018 5:03 AM > To: He, Bo > Cc: Steven Rostedt ; linux-kernel@vger.kernel.org; josh@joshtriplett.org; mathieu.desnoyers@efficios.com; jiangshanlai@gmail.com; Zhang, Jun ; Xiao, Jin ; Zhang, Yanmin ; Bai, Jie A > Subject: Re: rcu_preempt caused oom > > On Wed, Dec 12, 2018 at 07:42:24AM -0800, Paul E. McKenney wrote: > > On Wed, Dec 12, 2018 at 01:21:33PM +0000, He, Bo wrote: > > > we reproduce on two boards, but I still not see the show_rcu_gp_kthreads() dump logs, it seems the patch can't catch the scenario. > > > I double confirmed the CONFIG_PROVE_RCU=y is enabled in the config as it's extracted from the /proc/config.gz. > > > > Strange. > > > > Are the systems responsive to sysrq keys once failure occurs? If so, > > I will provide you a sysrq-R or some such to dump out the RCU state. > > Or, as it turns out, sysrq-y if booting with rcutree.sysrq_rcu=1 using the patch below. Only lightly tested. ------------------------------------------------------------------------ commit 04b6245c8458e8725f4169e62912c1fadfdf8141 Author: Paul E. McKenney Date: Wed Dec 12 16:10:09 2018 -0800 rcu: Add sysrq rcu_node-dump capability Backported from v4.21/v5.0 Life is hard if RCU manages to get stuck without triggering RCU CPU stall warnings or triggering the rcu_check_gp_start_stall() checks for failing to start a grace period. This commit therefore adds a boot-time-selectable sysrq key (commandeering "y") that allows manually dumping Tree RCU state. The new rcutree.sysrq_rcu kernel boot parameter must be set for this sysrq to be available. Signed-off-by: Paul E. McKenney diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 0b760c1369f7..e9392a9d6291 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -61,6 +61,7 @@ #include #include #include +#include #include "tree.h" #include "rcu.h" @@ -128,6 +129,9 @@ int num_rcu_lvl[] = NUM_RCU_LVL_INIT; int rcu_num_nodes __read_mostly = NUM_RCU_NODES; /* Total # rcu_nodes in use. */ /* panic() on RCU Stall sysctl. */ int sysctl_panic_on_rcu_stall __read_mostly; +/* Commandeer a sysrq key to dump RCU's tree. */ +static bool sysrq_rcu; +module_param(sysrq_rcu, bool, 0444); /* * The rcu_scheduler_active variable is initialized to the value @@ -662,6 +666,27 @@ void show_rcu_gp_kthreads(void) } EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads); +/* Dump grace-period-request information due to commandeered sysrq. */ +static void sysrq_show_rcu(int key) +{ + show_rcu_gp_kthreads(); +} + +static struct sysrq_key_op sysrq_rcudump_op = { + .handler = sysrq_show_rcu, + .help_msg = "show-rcu(y)", + .action_msg = "Show RCU tree", + .enable_mask = SYSRQ_ENABLE_DUMP, +}; + +static int __init rcu_sysrq_init(void) +{ + if (sysrq_rcu) + return register_sysrq_key('y', &sysrq_rcudump_op); + return 0; +} +early_initcall(rcu_sysrq_init); + /* * Send along grace-period-related data for rcutorture diagnostics. */