From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbcBORdB (ORCPT ); Mon, 15 Feb 2016 12:33:01 -0500 Received: from smtprelay0094.hostedemail.com ([216.40.44.94]:46381 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753009AbcBORc6 (ORCPT ); Mon, 15 Feb 2016 12:32:58 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:965:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2741:3138:3139:3140:3141:3142:3165:3353:3622:3865:3867:3868:3871:3872:3873:4250:4390:5007:6261:6755:7862:7875:9108:10004:10400:10848:10967:11026:11232:11658:11914:12043:12219:12438:12517:12519:12555:12740:13069:13311:13357:14659:21080:30012:30054:30074:30090:30091,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,LFtime:1,LUA_SUMMARY:none X-HE-Tag: title70_53f576389f007 X-Filterd-Recvd-Size: 2817 Date: Mon, 15 Feb 2016 12:32:56 -0500 From: Steven Rostedt To: Denis Kirjanov Cc: linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com Subject: Re: [PATCH 1/2] tracing/mm: don't trace kfree on offline CPUs Message-ID: <20160215123256.6b4cc115@gandalf.local.home> In-Reply-To: References: <1455387773-4245-1-git-send-email-kda@linux-powerpc.org> <20160214114537.79a6dbb3@grimm.local.home> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; 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 Sun, 14 Feb 2016 23:19:42 +0300 Denis Kirjanov wrote: > >> TP_PROTO(unsigned long call_site, const void *ptr), > >> > >> - TP_ARGS(call_site, ptr) > >> + TP_ARGS(call_site, ptr), > >> + > >> + /* > >> + * This trace can be potentially called from an offlined cpu. > >> + * Since trace points use RCU and RCU should not be used from > >> + * offline cpus, filter such calls out. > >> + * While this trace can be called from a preemptable section, > >> + * it has no impact on the condition since tasks can migrate > >> + * only from online cpus to other online cpus. Thus its safe > >> + * to use raw_smp_processor_id. > >> + */ > >> + TP_CONDITION(cpu_online(raw_smp_processor_id())) > > > > This is starting to become a common occurrence. Perhaps it is best to > > just hardcode this into the tracepoint code itself? > > Can you take it as a fix for now. I'll post the follow-up patch then > for rcu and offline cpus > issue. Actually, I prefer not to add more checks for cpu_online(), if its going to become the default. Does this work for you instead? -- Steve diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index acd522a91539..acfdbf353a0b 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -14,8 +14,10 @@ * See the file COPYING for more details. */ +#include #include #include +#include #include #include @@ -132,6 +134,9 @@ extern void syscall_unregfunc(void); void *it_func; \ void *__data; \ \ + if (!cpu_online(raw_smp_processor_id())) \ + return; \ + \ if (!(cond)) \ return; \ prercu; \