All of lore.kernel.org
 help / color / mirror / Atom feed
* tracing: Replace __get_cpu_var uses with this_cpu_ptr
@ 2014-04-29 19:17 Christoph Lameter
  2014-05-06 12:35 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2014-04-29 19:17 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Frederic Weisbecker, Masami Hiramatsu, linux-kernel

Replace uses of &__get_cpu_var for address calculation with this_cpu_ptr.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Christoph Lameter <cl@linux.com>

Index: linux/include/linux/kprobes.h
===================================================================
--- linux.orig/include/linux/kprobes.h	2014-04-28 13:09:07.228660946 -0500
+++ linux/include/linux/kprobes.h	2014-04-28 13:09:07.224661022 -0500
@@ -356,7 +356,7 @@

 static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
 {
-	return (&__get_cpu_var(kprobe_ctlblk));
+	return this_cpu_ptr(&kprobe_ctlblk);
 }

 int register_kprobe(struct kprobe *p);
Index: linux/kernel/trace/ftrace.c
===================================================================
--- linux.orig/kernel/trace/ftrace.c	2014-04-28 13:09:07.228660946 -0500
+++ linux/kernel/trace/ftrace.c	2014-04-28 13:09:07.224661022 -0500
@@ -817,7 +817,7 @@

 	local_irq_save(flags);

-	stat = &__get_cpu_var(ftrace_profile_stats);
+	stat = this_cpu_ptr(&ftrace_profile_stats);
 	if (!stat->hash || !ftrace_profile_enabled)
 		goto out;

@@ -848,7 +848,7 @@
 	unsigned long flags;

 	local_irq_save(flags);
-	stat = &__get_cpu_var(ftrace_profile_stats);
+	stat = this_cpu_ptr(&ftrace_profile_stats);
 	if (!stat->hash || !ftrace_profile_enabled)
 		goto out;

Index: linux/kernel/trace/trace.c
===================================================================
--- linux.orig/kernel/trace/trace.c	2014-04-28 13:09:07.228660946 -0500
+++ linux/kernel/trace/trace.c	2014-04-28 13:09:07.228660946 -0500
@@ -1728,7 +1728,7 @@
 	 */
 	barrier();
 	if (use_stack == 1) {
-		trace.entries		= &__get_cpu_var(ftrace_stack).calls[0];
+		trace.entries		= this_cpu_ptr(ftrace_stack.calls);
 		trace.max_entries	= FTRACE_STACK_MAX_ENTRIES;

 		if (regs)

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

* Re: tracing: Replace __get_cpu_var uses with this_cpu_ptr
  2014-04-29 19:17 tracing: Replace __get_cpu_var uses with this_cpu_ptr Christoph Lameter
@ 2014-05-06 12:35 ` Steven Rostedt
  2014-05-06 14:53   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2014-05-06 12:35 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Ingo Molnar, Frederic Weisbecker, Masami Hiramatsu, linux-kernel

On Tue, 29 Apr 2014 14:17:40 -0500 (CDT)
Christoph Lameter <cl@linux.com> wrote:

> Replace uses of &__get_cpu_var for address calculation with this_cpu_ptr.
> 

I pulled this into my 3.16 queue.

-- Steve

> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Signed-off-by: Christoph Lameter <cl@linux.com>
> 
> Index: linux/include/linux/kprobes.h
> ===================================================================
> --- linux.orig/include/linux/kprobes.h	2014-04-28 13:09:07.228660946 -0500
> +++ linux/include/linux/kprobes.h	2014-04-28 13:09:07.224661022 -0500
> @@ -356,7 +356,7 @@
> 
>  static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
>  {
> -	return (&__get_cpu_var(kprobe_ctlblk));
> +	return this_cpu_ptr(&kprobe_ctlblk);
>  }
> 
>  int register_kprobe(struct kprobe *p);
> Index: linux/kernel/trace/ftrace.c
> ===================================================================
> --- linux.orig/kernel/trace/ftrace.c	2014-04-28 13:09:07.228660946 -0500
> +++ linux/kernel/trace/ftrace.c	2014-04-28 13:09:07.224661022 -0500
> @@ -817,7 +817,7 @@
> 
>  	local_irq_save(flags);
> 
> -	stat = &__get_cpu_var(ftrace_profile_stats);
> +	stat = this_cpu_ptr(&ftrace_profile_stats);
>  	if (!stat->hash || !ftrace_profile_enabled)
>  		goto out;
> 
> @@ -848,7 +848,7 @@
>  	unsigned long flags;
> 
>  	local_irq_save(flags);
> -	stat = &__get_cpu_var(ftrace_profile_stats);
> +	stat = this_cpu_ptr(&ftrace_profile_stats);
>  	if (!stat->hash || !ftrace_profile_enabled)
>  		goto out;
> 
> Index: linux/kernel/trace/trace.c
> ===================================================================
> --- linux.orig/kernel/trace/trace.c	2014-04-28 13:09:07.228660946 -0500
> +++ linux/kernel/trace/trace.c	2014-04-28 13:09:07.228660946 -0500
> @@ -1728,7 +1728,7 @@
>  	 */
>  	barrier();
>  	if (use_stack == 1) {
> -		trace.entries		= &__get_cpu_var(ftrace_stack).calls[0];
> +		trace.entries		= this_cpu_ptr(ftrace_stack.calls);
>  		trace.max_entries	= FTRACE_STACK_MAX_ENTRIES;
> 
>  		if (regs)


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

* Re: tracing: Replace __get_cpu_var uses with this_cpu_ptr
  2014-05-06 12:35 ` Steven Rostedt
@ 2014-05-06 14:53   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2014-05-06 14:53 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Frederic Weisbecker, Masami Hiramatsu, linux-kernel

On Tue, 6 May 2014, Steven Rostedt wrote:

> I pulled this into my 3.16 queue.

Thanks.

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

end of thread, other threads:[~2014-05-06 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-29 19:17 tracing: Replace __get_cpu_var uses with this_cpu_ptr Christoph Lameter
2014-05-06 12:35 ` Steven Rostedt
2014-05-06 14:53   ` Christoph Lameter

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.