From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbdLNEej (ORCPT ); Wed, 13 Dec 2017 23:34:39 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34124 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbdLNEeh (ORCPT ); Wed, 13 Dec 2017 23:34:37 -0500 Date: Wed, 13 Dec 2017 20:34:34 -0800 From: "Paul E. McKenney" To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton Subject: Re: [for-next][PATCH 7/7] tracing: Have stack trace not record if RCU is not watching Reply-To: paulmck@linux.vnet.ibm.com References: <20171213204656.366789624@goodmis.org> <20171213204738.186059620@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171213204738.186059620@goodmis.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17121404-0008-0000-0000-000002AF33D0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008202; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000244; SDB=6.00959923; UDB=6.00485515; IPR=6.00739940; BA=6.00005740; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018531; XFM=3.00000015; UTC=2017-12-14 04:34:34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17121404-0009-0000-0000-000037965D23 Message-Id: <20171214043434.GO7829@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-14_02:,, 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-1712140063 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 13, 2017 at 03:47:03PM -0500, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > The stack tracer records a stack dump whenever it sees a stack usage that is > more than what it ever saw before. This can happen at any function that is > being traced. If it happens when the CPU is going idle (or other strange > locations), RCU may not be watching, and in this case, the recording of the > stack trace will trigger a warning. There's been lots of efforts to make > hacks to allow stack tracing to proceed even if RCU is not watching, but > this only causes more issues to appear. Simply do not trace a stack if RCU > is not watching. It probably isn't a bad stack anyway. > > Cc: "Paul E. McKenney" > Signed-off-by: Steven Rostedt (VMware) Acked-by: "Paul E. McKenney" > --- > kernel/trace/trace_stack.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c > index 734accc02418..3c7bfc4bf5e9 100644 > --- a/kernel/trace/trace_stack.c > +++ b/kernel/trace/trace_stack.c > @@ -209,6 +209,10 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip, > if (__this_cpu_read(disable_stack_tracer) != 1) > goto out; > > + /* If rcu is not watching, then save stack trace can fail */ > + if (!rcu_is_watching()) > + goto out; > + > ip += MCOUNT_INSN_SIZE; > > check_stack(ip, &stack); > -- > 2.13.2 > >