From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbbJTXsa (ORCPT ); Tue, 20 Oct 2015 19:48:30 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:36656 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbbJTXs3 (ORCPT ); Tue, 20 Oct 2015 19:48:29 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 20 Oct 2015 16:48:30 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Peter Zijlstra , LKML Subject: Re: [RFC][PATCH] tracing: Have stack tracer force RCU to be watching Message-ID: <20151020234830.GK5105@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20151020121031.2f9d72c1@gandalf.local.home> <20151020202528.GF5105@linux.vnet.ibm.com> <20151020173228.3e4edda5@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151020173228.3e4edda5@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15102023-0017-0000-0000-00000EDC5B83 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2015 at 05:32:28PM -0400, Steven Rostedt wrote: > On Tue, 20 Oct 2015 13:25:28 -0700 > "Paul E. McKenney" wrote: > > > On Tue, Oct 20, 2015 at 12:10:31PM -0400, Steven Rostedt wrote: > > > > > > Paul, > > > > > > I've spent a couple of days debugging this, and finally found that my > > > stack tracer was calling the stack trace code, which calls > > > __module_address() which asserts the below. > > > > > > Is just calling rcu_irq_enter() and rcu_irq_exit() safe to do > > > everywhere (with interrupts always disabled)? This patch appears to fix > > > the bug. > > > > Yep! Just don't call it from an NMI handler. And don't call it with > > interrupts enabled. The patch looks to have interrupts always disabled, > > and the surrounding code doesn't look like NMI-safe code anyway, so > > should be OK. > > > > Thanx, Paul > > > > Hmm, good point about NMI handler. Right now I think the only thing > protecting this from getting in the critical section while in NMI is > the check that we are using the task struct stack. But that may not be > enough in 32 bit. > > I should probably add a "if (in_nmi()) return" somewhere. Please! ;-) ;-) ;-) Thanx, Paul