tracing: use __this_cpu_read() in trace_buffered_event_enable()
PATCH 1/1 tracing: use __this_cpu_read() in trace_buffered_event_enable()
The code is executed with preemption disabled, so it's safe to use __this_cpu_read().
--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace.c +1 -1
@@ -2514,7 +2514,7 @@ void trace_buffered_event_enable(void)preempt_disable ();if (cpu ==smp_processor_id () && -this_cpu_read (trace_buffered_event) != +__this_cpu_read (trace_buffered_event) !=per_cpu (trace_buffered_event, cpu))WARN_ON_ONCE (1 );preempt_enable ();
Signature · 1 line
2.17.1
Steven Rostedt
maintainerSorry for the late reply (been busy with Linux Plumbers, took a vacation, and then trying to catch up on all my email for the last two months!)
But I just wanted to let you know that I added this to my queue.
Thanks!
-- Steve
Quoted 21 lines · On Thu, 13 Aug 2020 19:28:03 +0800 Xianting Tian <[email protected]> wrote:
The code is executed with preemption disabled, so it's safe to use
__this_cpu_read().Signed-off-by Xianting Tian <[email protected]>--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/trace.c +1
-1@@ -2514,7 +2514,7 @@ void trace_buffered_event_enable(void)preempt_disable ();if (cpu ==smp_processor_id () && -this_cpu_read (trace_buffered_event) != +__this_cpu_read (trace_buffered_event) !=per_cpu (trace_buffered_event, cpu))WARN_ON_ONCE (1 );preempt_enable ();
Hi Steven,
Thanks for your reply:)
-----Original Message-----
From: Steven Rostedt [mailto:[email protected]]
Sent: Friday, September 18, 2020 8:31 AM
To: tianxianting (RD) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable()
Sorry for the late reply (been busy with Linux Plumbers, took a vacation, and then trying to catch up on all my email for the last two months!)
But I just wanted to let you know that I added this to my queue.
Thanks!
-- Steve
Quoted 21 lines · On Thu, 13 Aug 2020 19:28:03 +0800 Xianting Tian <[email protected]> wrote:
The code is executed with preemption disabled, so it's safe to use
__this_cpu_read().Signed-off-by Xianting Tian <[email protected]>--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/trace.c index renamed from kernel/trace/trace.c +0
-0
bb6226972..7d0d71ce9100644kernel/trace/trace.c +1
-1@@ -2514,7 +2514,7 @@ void trace_buffered_event_enable(void)preempt_disable ();if (cpu ==smp_processor_id () && -this_cpu_read (trace_buffered_event) != +__this_cpu_read (trace_buffered_event) !=per_cpu (trace_buffered_event, cpu))WARN_ON_ONCE (1 );preempt_enable ();