All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 07/13] tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver()
Date: Tue, 07 Dec 2021 16:44:13 -0500	[thread overview]
Message-ID: <20211207214430.208265184@goodmis.org> (raw)
In-Reply-To: 20211207214406.148423650@goodmis.org

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

The value read by this_cpu_read() is used later and its use is expected to
stay on the same CPU as being read. But this_cpu_read() does not warn if
it is called without preemption disabled, where as __this_cpu_read() will
check if preemption is disabled on CONFIG_DEBUG_PREEMPT

Currently all callers have preemption disabled, but there may be new
callers in the future that may not.

Link: https://lkml.kernel.org/r/20211130024318.698165354@goodmis.org

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4821fe6a40a5..2e87b7bf2ba7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2746,7 +2746,7 @@ trace_event_buffer_lock_reserve(struct trace_buffer **current_rb,
 
 	if (!tr->no_filter_buffering_ref &&
 	    (trace_file->flags & (EVENT_FILE_FL_SOFT_DISABLED | EVENT_FILE_FL_FILTERED)) &&
-	    (entry = this_cpu_read(trace_buffered_event))) {
+	    (entry = __this_cpu_read(trace_buffered_event))) {
 		/*
 		 * Filtering is on, so try to use the per cpu buffer first.
 		 * This buffer will simulate a ring_buffer_event,
-- 
2.33.0

  parent reply	other threads:[~2021-12-07 21:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 21:44 [for-next][PATCH 00/13] tracing: Updates for 5.17 Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 01/13] tracing: Fix spelling mistake "aritmethic" -> "arithmetic" Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 02/13] tracing: Support __rel_loc relative dynamic data location attribute Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 03/13] tracing: Add __rel_loc using trace event macros Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 04/13] samples/trace_event: Add __rel_loc using sample event Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 05/13] libtraceevent: Add __rel_loc relative location attribute support Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 06/13] tools/perf: Add __rel_loc event field parsing support Steven Rostedt
2021-12-07 21:44 ` Steven Rostedt [this message]
2021-12-07 21:44 ` [for-next][PATCH 08/13] tracing: Disable preemption when using the filter buffer Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 09/13] tracing: Have eprobes use filtering logic of trace events Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 10/13] tracing/kprobes: Do not open code event reserve logic Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 11/13] tracing/uprobes: Use trace_event_buffer_reserve() helper Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 12/13] tracing: Fix synth_event_add_val() kernel-doc comment Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 13/13] tracing: Switch to kvfree_rcu() API 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=20211207214430.208265184@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.