Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791AbbFPPht (ORCPT ); Tue, 16 Jun 2015 11:37:49 -0400 Received: from smtprelay0188.hostedemail.com ([216.40.44.188]:43091 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752049AbbFPPhm (ORCPT ); Tue, 16 Jun 2015 11:37:42 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2691:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4605:5007:6119:6261:7875:7903:8957:9038:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12555:12740:13069:13311:13357:14096:14097:21067:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: maid93_8ab762e67934 X-Filterd-Recvd-Size: 2612 Date: Tue, 16 Jun 2015 11:37:38 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: Alexei Starovoitov , Daniel Wagner , LKML Subject: Re: call_rcu from trace_preempt Message-ID: <20150616113738.3ab2667b@gandalf.local.home> In-Reply-To: <20150616122733.GG3913@linux.vnet.ibm.com> References: <557F509D.2000509@plumgrid.com> <20150615230702.GB3913@linux.vnet.ibm.com> <557F7764.5060707@plumgrid.com> <20150616021458.GE3913@linux.vnet.ibm.com> <557FB7E1.6080004@plumgrid.com> <20150616122733.GG3913@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; 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 Content-Length: 1761 Lines: 48 On Tue, 16 Jun 2015 05:27:33 -0700 "Paul E. McKenney" wrote: > On Mon, Jun 15, 2015 at 10:45:05PM -0700, Alexei Starovoitov wrote: > > On 6/15/15 7:14 PM, Paul E. McKenney wrote: > > > > > >Why do you believe that it is better to fix it within call_rcu()? > > > > found it: > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index 8cf7304b2867..a3be09d482ae 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -935,9 +935,9 @@ bool notrace rcu_is_watching(void) > > { > > bool ret; > > > > - preempt_disable(); > > + preempt_disable_notrace(); > > ret = __rcu_is_watching(); > > - preempt_enable(); > > + preempt_enable_notrace(); > > return ret; > > } > > > > the rcu_is_watching() and __rcu_is_watching() are already marked > > notrace, so imo it's a good 'fix'. > > What was happening is that the above preempt_enable was triggering > > recursive call_rcu that was indeed messing 'rdp' that was > > prepared by __call_rcu and before __call_rcu_core could use that. > > > btw, also noticed that local_irq_save done by note_gp_changes > > is partially redundant. In __call_rcu_core path the irqs are > > already disabled. > If rcu_is_watching() and __rcu_is_watching() are both marked as notrace, it makes sense to use preempt_disable/enable_notrace() as it otherwise defeats the purpose of the notrace markers on rcu_is_watching. That is regardless of what the rest of this thread is about. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/