From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755685AbdEROEo (ORCPT ); Thu, 18 May 2017 10:04:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:43572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754241AbdEROEl (ORCPT ); Thu, 18 May 2017 10:04:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5043C239BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 18 May 2017 10:04:38 -0400 From: Steven Rostedt To: Miroslav Benes Cc: "Paul E. McKenney" , LKML , Ingo Molnar , Thomas Gleixner Subject: Re: [PATCH v2] tracing: Make sure RCU is watching before calling a stack trace Message-ID: <20170518100438.6f0dc42e@gandalf.local.home> In-Reply-To: References: <20170518093809.13428efa@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 May 2017 15:48:55 +0200 (CEST) Miroslav Benes wrote: > On Thu, 18 May 2017, Steven Rostedt wrote: > > > > > From: "Steven Rostedt (VMware)" > > > > As stack tracing now requires "rcu watching", force RCU to be watching when > > recording a stack trace. > > > > Link: http://lkml.kernel.org/r/20170512172449.879684501@goodmis.org > > > > Cc: "Paul E. McKenney" > > Signed-off-by: Steven Rostedt (VMware) > > --- > > > > Changes since v1: > > > > My testing discovered that the stack trace can be called with > > interrupts enabled, which is a no no to have when calling > > rcu_irq_enter(). When interrupts are enabled, as with being in an > > NMI, RCU will also be watching. > > Would rcu_irq_enter_irqson() help then? This is what Petr used in a live > patching handler. > Yes, that could work too, but I wanted to avoid disabling interrupts if we didn't have to. > Your solution works too, of course. Just asking if I am not missing > something. > Nope, I was just trying to keep the overhead down. As this can be called by every event enabled, as well as functions being traced. I figured that local_save_irqs() is faster than a pair of local_irq_save()/ local_irq_restore() calls. -- Steve