From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753689AbbBESDv (ORCPT ); Thu, 5 Feb 2015 13:03:51 -0500 Received: from smtprelay0031.hostedemail.com ([216.40.44.31]:43753 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753244AbbBESDr (ORCPT ); Thu, 5 Feb 2015 13:03:47 -0500 X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:877:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1801:1981:2194:2199:2393:2553:2559:2562:2691:2693:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:3872:3874:4250:4321:4605:5007:6261:6742:7903:8660:9036:9108:10004:10400:10848:10967:11026:11232:11233:11473:11658:11914:12043:12296:12438:12517:12519:12555:12740:13148:13180:13229:13230: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: vein53_3dcc2c54f743c X-Filterd-Recvd-Size: 3754 Date: Thu, 5 Feb 2015 13:03:43 -0500 From: Steven Rostedt To: Dave Hansen Cc: sedat.dilek@gmail.com, Paul McKenney , "Rafael J. Wysocki" , "Rafael J. Wysocki" , linux-next , LKML , Stephen Rothwell , Kristen Carlson Accardi , "H. Peter Anvin" , Rik van Riel , Mel Gorman Subject: Re: linux-next: Tree for Feb 4 Message-ID: <20150205130343.6ac0eda9@gandalf.local.home> In-Reply-To: <54D3186F.7030500@sr71.net> References: <20150204193535.58f132c5@canb.auug.org.au> <1511573.AlfExlvQsO@vostro.rjw.lan> <20150204215357.GL5370@linux.vnet.ibm.com> <11131483.LrRNxJumiL@vostro.rjw.lan> <20150204235115.GP5370@linux.vnet.ibm.com> <20150205001019.GA12362@linux.vnet.ibm.com> <20150205005716.GS5370@linux.vnet.ibm.com> <20150205015144.GT5370@linux.vnet.ibm.com> <54D3186F.7030500@sr71.net> 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 On Wed, 04 Feb 2015 23:14:55 -0800 Dave Hansen wrote: > On 02/04/2015 05:53 PM, Sedat Dilek wrote: > > The architecture-specific switch_mm() function can be called by offline > > CPUs, but includes event tracing, which cannot be legally carried out > > on offline CPUs. This results in a lockdep-RCU splat. This commit fixes > > this splat by omitting the tracing when the CPU is offline. > ... > >>> >> > load_cr3(next->pgd); > >>> >> > - trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL); > >>> >> > + if (cpu_online(smp_processor_id())) > >>> >> > + trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL); > > Is this, perhaps, something that we should be doing in the generic trace > code so that all of the trace users don't have to worry about it? Also, > this patch will add overhead to the code when tracing is off. It would > be best if we could manage to make the cpu_online() check only in the > cases where the tracepoint is on. Note, we can move the check into the code that enables or disables trace points. I believe, the rcu part of a tracepoint is only the call to the callbacks. The jump_label part should be safe outside of rcu. In that case, instead, have this, which does exactly the same thing without having any overhead of the branch when tracing is disabled: (not tested) Signed-off-by: Steven Rostedt --- diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h index 13391d288107..040c1cdfe6d1 100644 --- a/include/trace/events/tlb.h +++ b/include/trace/events/tlb.h @@ -13,11 +13,13 @@ { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } -TRACE_EVENT(tlb_flush, +TRACE_EVENT_CONDITION(tlb_flush, TP_PROTO(int reason, unsigned long pages), TP_ARGS(reason, pages), + TP_CONDITION(cpu_online(smp_processor_id()), + TP_STRUCT__entry( __field( int, reason) __field(unsigned long, pages)