From: tip-bot for Tejun Heo <tj@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
fweisbec@gmail.com, eric.dumazet@gmail.com, rostedt@goodmis.org,
tj@kernel.org, tglx@linutronix.de, jolsa@redhat.com
Subject: [tip:perf/urgent] trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
Date: Mon, 5 Dec 2011 09:34:22 -0800 [thread overview]
Message-ID: <tip-d3d9acf646679c1981032b0985b386d12fccc60c@git.kernel.org> (raw)
In-Reply-To: <20111123164949.GA29639@google.com>
Commit-ID: d3d9acf646679c1981032b0985b386d12fccc60c
Gitweb: http://git.kernel.org/tip/d3d9acf646679c1981032b0985b386d12fccc60c
Author: Tejun Heo <tj@kernel.org>
AuthorDate: Wed, 23 Nov 2011 08:49:49 -0800
Committer: Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu, 1 Dec 2011 22:16:47 -0500
trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
ftrace_event_call->filter is sched RCU protected but didn't use
rcu_assign_pointer(). Use it.
TODO: Add proper __rcu annotation to call->filter and all its users.
-v2: Use RCU_INIT_POINTER() for %NULL clearing as suggested by Eric.
Link: http://lkml.kernel.org/r/20111123164949.GA29639@google.com
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: stable@kernel.org # (2.6.39+)
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_events_filter.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 816d3d0..d6e7926 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1686,7 +1686,7 @@ static int replace_system_preds(struct event_subsystem *system,
* replace the filter for the call.
*/
filter = call->filter;
- call->filter = filter_item->filter;
+ rcu_assign_pointer(call->filter, filter_item->filter);
filter_item->filter = filter;
fail = false;
@@ -1741,7 +1741,7 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
filter = call->filter;
if (!filter)
goto out_unlock;
- call->filter = NULL;
+ RCU_INIT_POINTER(call->filter, NULL);
/* Make sure the filter is not being used */
synchronize_sched();
__free_filter(filter);
@@ -1782,7 +1782,7 @@ out:
* string
*/
tmp = call->filter;
- call->filter = filter;
+ rcu_assign_pointer(call->filter, filter);
if (tmp) {
/* Make sure the call is done with the filter */
synchronize_sched();
prev parent reply other threads:[~2011-12-05 17:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 1:46 [PATCH 1/2] trace_events_filter: use " Tejun Heo
2011-11-23 2:00 ` [PATCH 2/2] trace_event_filter: factorize filter creation Tejun Heo
2011-11-23 15:19 ` Steven Rostedt
2011-11-23 15:59 ` Tejun Heo
2011-11-28 20:49 ` Tejun Heo
2011-11-28 22:15 ` Steven Rostedt
2011-12-08 23:32 ` Tejun Heo
2011-12-09 0:15 ` Steven Rostedt
2011-12-09 0:46 ` Steven Rostedt
2011-12-09 18:55 ` Tejun Heo
2011-12-09 19:43 ` [PATCH 2/2 UPDATED] " Tejun Heo
2011-11-23 15:16 ` [PATCH 1/2] trace_events_filter: use rcu_assign_pointer() when setting ftrace_event_call->filter Steven Rostedt
2011-11-23 16:06 ` Tejun Heo
2011-11-23 16:12 ` Tejun Heo
2011-11-23 17:06 ` Steven Rostedt
2011-11-23 17:33 ` Tejun Heo
2011-11-28 16:49 ` Paul E. McKenney
2011-11-23 16:40 ` Eric Dumazet
2011-11-23 16:44 ` Tejun Heo
2011-11-23 16:49 ` [PATCH UPDATED " Tejun Heo
2011-12-05 17:34 ` tip-bot for Tejun Heo [this message]
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=tip-d3d9acf646679c1981032b0985b386d12fccc60c@git.kernel.org \
--to=tj@kernel.org \
--cc=eric.dumazet@gmail.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome