public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Dave Hansen <dave@sr71.net>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-next <linux-next@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Kristen Carlson Accardi <kristen@linux.intel.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sedat Dilek <sedat.dilek@gmail.com>
Subject: [PATCH 1/2] tracing: Add condition check to RCU lockdep checks
Date: Fri, 06 Feb 2015 15:06:54 -0500	[thread overview]
Message-ID: <20150206200800.552335453@goodmis.org> (raw)
In-Reply-To: 20150206200653.009919583@goodmis.org

[-- Attachment #1: 0001-tracing-Add-condition-check-to-RCU-lockdep-checks.patch --]
[-- Type: text/plain, Size: 1828 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The trace_tlb_flush() tracepoint can be called when a CPU is going offline.
When a CPU is offline, RCU is no longer watching that CPU and since the
tracepoint is protected by RCU, it must not be called. To prevent the
tlb_flush tracepoint from being called when the CPU is offline, it was
converted to a TRACE_EVENT_CONDITION where the condition checks if the
CPU is online before calling the tracepoint.

Unfortunately, this was not enough to stop lockdep from complaining about
it. Even though the RCU protected code of the tracepoint will never be
called, the condition is hidden within the tracepoint, and even though the
condition prevents RCU code from being called, the lockdep checks are
outside the tracepoint (this is to test tracepoints even when they are not
enabled).

Even though tracepoints should be checked to be RCU safe when they are not
enabled, the condition should still be considered when checking RCU.

Link: http://lkml.kernel.org/r/CA+icZUUGiGDoL5NU8RuxKzFjoLjEKRtUWx=JB8B9a0EQv-eGzQ@mail.gmail.com

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/tracepoint.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index e08e21e5f601..68a346b8328a 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -173,7 +173,7 @@ extern void syscall_unregfunc(void);
 				TP_PROTO(data_proto),			\
 				TP_ARGS(data_args),			\
 				TP_CONDITION(cond),,);			\
-		if (IS_ENABLED(CONFIG_LOCKDEP)) {			\
+		if (IS_ENABLED(CONFIG_LOCKDEP) && cond) {			\
 			rcu_read_lock_sched_notrace();			\
 			rcu_dereference_sched(__tracepoint_##name.funcs);\
 			rcu_read_unlock_sched_notrace();		\
-- 
2.1.4

  reply	other threads:[~2015-02-06 20:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 20:06 [PATCH 0/2] tracing/tlb/x85: Fix splat of calling RCU trace code on offline CPU Steven Rostedt
2015-02-06 20:06 ` Steven Rostedt [this message]
2015-02-06 20:11   ` [PATCH 1/2] tracing: Add condition check to RCU lockdep checks Steven Rostedt
2015-02-06 20:13   ` [PATCH 1/2 v2] " Steven Rostedt
2015-02-06 20:06 ` [PATCH 2/2] x86/tbl/trace: Do not trace on CPU that is offline Steven Rostedt
2015-02-06 23:27   ` Paul E. McKenney
2015-02-07  4:02     ` Steven Rostedt
2015-02-07  8:01       ` Sedat Dilek
2015-02-07 15:20         ` Steven Rostedt
2015-02-07 19:50           ` Sedat Dilek
2015-02-07 20:09           ` Paul E. McKenney
2015-02-07 20:14             ` Sedat Dilek
2015-02-07 21:52             ` Steven Rostedt
2015-02-07 22:14               ` Paul E. McKenney
2015-02-07 23:01                 ` Sedat Dilek
2015-02-07 23:48               ` Dave Hansen
2015-02-07  8:13       ` Sedat Dilek
2015-02-07 15:22         ` Steven Rostedt
2015-02-06 21:07 ` [PATCH 0/2] tracing/tlb/x85: Fix splat of calling RCU trace code on offline CPU Sedat Dilek
2015-02-06 21:18   ` Steven Rostedt
2015-02-06 21:19     ` Steven Rostedt
2015-02-06 21:23       ` Sedat Dilek
2015-02-06 21:27         ` Steven Rostedt
2015-02-06 21:24       ` Steven Rostedt
2015-02-06 21:29         ` Sedat Dilek
2015-02-06 21:21     ` Sedat Dilek
2015-02-06 21:28       ` Steven Rostedt
2015-02-06 21:33       ` Steven Rostedt
2015-02-06 21:38   ` Paul E. McKenney
2015-02-06 22:13     ` Sedat Dilek
2015-02-06 22:35       ` Steven Rostedt
2015-02-06 22:48         ` Paul E. McKenney
2015-02-06 22:51           ` Sedat Dilek
2015-02-06 23:02             ` Sedat Dilek
2015-02-06 23:04             ` Paul E. McKenney
2015-02-06 23:04           ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150206200800.552335453@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@sr71.net \
    --cc=hpa@linux.intel.com \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=sedat.dilek@gmail.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox