linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable()
@ 2020-08-13 11:28 Xianting Tian
  2020-09-18  0:31 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Xianting Tian @ 2020-08-13 11:28 UTC (permalink / raw)
  To: rostedt, mingo; +Cc: linux-kernel, Xianting Tian

The code is executed with preemption disabled, so it's
safe to use __this_cpu_read().

Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
---
 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 bb6226972..7d0d71ce9 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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();
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable()
  2020-08-13 11:28 [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Xianting Tian
@ 2020-09-18  0:31 ` Steven Rostedt
  2020-09-18  1:21   ` Tianxianting
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2020-09-18  0:31 UTC (permalink / raw)
  To: Xianting Tian; +Cc: mingo, linux-kernel

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


On Thu, 13 Aug 2020 19:28:03 +0800
Xianting Tian <tian.xianting@h3c.com> wrote:

> The code is executed with preemption disabled, so it's
> safe to use __this_cpu_read().
> 
> Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
> ---
>  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 bb6226972..7d0d71ce9 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -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();


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable()
  2020-09-18  0:31 ` Steven Rostedt
@ 2020-09-18  1:21   ` Tianxianting
  0 siblings, 0 replies; 3+ messages in thread
From: Tianxianting @ 2020-09-18  1:21 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: mingo, linux-kernel

Hi Steven,
Thanks for your reply:)

-----Original Message-----
From: Steven Rostedt [mailto:rostedt@goodmis.org] 
Sent: Friday, September 18, 2020 8:31 AM
To: tianxianting (RD) <tian.xianting@h3c.com>
Cc: mingo@redhat.com; linux-kernel@vger.kernel.org
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


On Thu, 13 Aug 2020 19:28:03 +0800
Xianting Tian <tian.xianting@h3c.com> wrote:

> The code is executed with preemption disabled, so it's safe to use 
> __this_cpu_read().
> 
> Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
> ---
>  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 
> bb6226972..7d0d71ce9 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -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();


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-18  1:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 11:28 [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Xianting Tian
2020-09-18  0:31 ` Steven Rostedt
2020-09-18  1:21   ` Tianxianting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).