public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* linux-next: percpu tree build failure
@ 2009-10-13  3:48 Stephen Rothwell
  2009-10-13 14:29 ` [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2009-10-13  3:48 UTC (permalink / raw)
  To: Tejun Heo, Rusty Russell, Christoph Lameter, Ingo Molnar
  Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

Hi all,

Today's linux-next build (x86_64 allmodconfig) failed like this:

kernel/trace/trace_functions_graph.c: In function '__trace_graph_entry':
kernel/trace/trace_functions_graph.c:179: error: request for member 'a' in something not a structure or union
kernel/trace/trace_functions_graph.c: In function '__trace_graph_return':
kernel/trace/trace_functions_graph.c:243: error: request for member 'a' in something not a structure or union

Caused by commit 9288f99aa52d90a5b82573c4b769c97c55af2f56 ("this_cpu: Use
this_cpu_xx for ftrace").

I have used the version of the percpu tree from next-20091012 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13  3:48 linux-next: percpu tree build failure Stephen Rothwell
@ 2009-10-13 14:29 ` Tejun Heo
  2009-10-13 14:36   ` Christoph Lameter
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2009-10-13 14:29 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Rusty Russell, Christoph Lameter, Ingo Molnar, linux-next,
	linux-kernel

ftrace_cpu_disabled usage in trace_functions_graph.c were left out
during this_cpu_xx conversion in commit 9288f99a causing compile
failure.  Convert them.

Signed-off-by: Tejun Heo <tj@kernel•org>
Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: Christoph Lameter <cl@linux-foundation•org>
---
This patch has been committed to percpu#for-next.  Thanks.

 kernel/trace/trace_functions_graph.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 45e6c01..90a6daa 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -176,7 +176,7 @@ static int __trace_graph_entry(struct trace_array *tr,
 	struct ring_buffer *buffer = tr->buffer;
 	struct ftrace_graph_ent_entry *entry;

-	if (unlikely(local_read(&__get_cpu_var(ftrace_cpu_disabled))))
+	if (unlikely(__this_cpu_read(per_cpu_var(ftrace_cpu_disabled))))
 		return 0;

 	event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_ENT,
@@ -240,7 +240,7 @@ static void __trace_graph_return(struct trace_array *tr,
 	struct ring_buffer *buffer = tr->buffer;
 	struct ftrace_graph_ret_entry *entry;

-	if (unlikely(local_read(&__get_cpu_var(ftrace_cpu_disabled))))
+	if (unlikely(__this_cpu_read(per_cpu_var(ftrace_cpu_disabled))))
 		return;

 	event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_RET,
-- 
1.6.4.2

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

* Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13 14:29 ` [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c Tejun Heo
@ 2009-10-13 14:36   ` Christoph Lameter
  2009-10-13 14:47     ` Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Lameter @ 2009-10-13 14:36 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Stephen Rothwell, Rusty Russell, Ingo Molnar, linux-next,
	linux-kernel

On Tue, 13 Oct 2009, Tejun Heo wrote:

> ftrace_cpu_disabled usage in trace_functions_graph.c were left out
> during this_cpu_xx conversion in commit 9288f99a causing compile
> failure.  Convert them.

Thanks.

Reviewed-by: Christoph Lameter <cl@linux-foundation•org>

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

* Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13 14:47     ` Tejun Heo
@ 2009-10-13 14:45       ` Christoph Lameter
  2009-10-13 14:57         ` Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Lameter @ 2009-10-13 14:45 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Stephen Rothwell, Rusty Russell, Ingo Molnar, linux-next,
	linux-kernel

On Tue, 13 Oct 2009, Tejun Heo wrote:

> Oh... one question tho.  I used __this_cpu_*() as other conversions
> but I think we should be using the version without the underscores.
> The relationship between get_cpu_var() and __get_cpu_var() is
> different from the one between this_cpu_*() and __this_cpu_*().

For operations like inc/add/dec/sub you need to use the version with __
otherwise the arches that do not support these operations will have to
generate useless expensive code that disables / reenables preempt.

For this_cpu_ptr / __this_cpu_ptr it does not matter. this_cpu_ptr gives
you additional checks.

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

* Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13 14:36   ` Christoph Lameter
@ 2009-10-13 14:47     ` Tejun Heo
  2009-10-13 14:45       ` Christoph Lameter
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2009-10-13 14:47 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Stephen Rothwell, Rusty Russell, Ingo Molnar, linux-next,
	linux-kernel

Christoph Lameter wrote:
> On Tue, 13 Oct 2009, Tejun Heo wrote:
> 
>> ftrace_cpu_disabled usage in trace_functions_graph.c were left out
>> during this_cpu_xx conversion in commit 9288f99a causing compile
>> failure.  Convert them.
> 
> Thanks.
> 
> Reviewed-by: Christoph Lameter <cl@linux-foundation•org>

Oh... one question tho.  I used __this_cpu_*() as other conversions
but I think we should be using the version without the underscores.
The relationship between get_cpu_var() and __get_cpu_var() is
different from the one between this_cpu_*() and __this_cpu_*().

Thanks.

-- 
tejun

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

* Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13 14:45       ` Christoph Lameter
@ 2009-10-13 14:57         ` Tejun Heo
  2009-10-13 15:14           ` Christoph Lameter
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2009-10-13 14:57 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Stephen Rothwell, Rusty Russell, Ingo Molnar, linux-next,
	linux-kernel

Christoph Lameter wrote:
> On Tue, 13 Oct 2009, Tejun Heo wrote:
> 
>> Oh... one question tho.  I used __this_cpu_*() as other conversions
>> but I think we should be using the version without the underscores.
>> The relationship between get_cpu_var() and __get_cpu_var() is
>> different from the one between this_cpu_*() and __this_cpu_*().
> 
> For operations like inc/add/dec/sub you need to use the version with __
> otherwise the arches that do not support these operations will have to
> generate useless expensive code that disables / reenables preempt.
> 
> For this_cpu_ptr / __this_cpu_ptr it does not matter. this_cpu_ptr gives
> you additional checks.

Yes, you're right.  The naming scheme in percpu sucks really hard.
The subtle differences among [__]get_cpu_var(), [__]this_cpu_ptr() and
other this_cpu ops.  Arghhhhhh.......

-- 
tejun

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

* Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
  2009-10-13 14:57         ` Tejun Heo
@ 2009-10-13 15:14           ` Christoph Lameter
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2009-10-13 15:14 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Stephen Rothwell, Rusty Russell, Ingo Molnar, linux-next,
	linux-kernel

On Tue, 13 Oct 2009, Tejun Heo wrote:

> > For this_cpu_ptr / __this_cpu_ptr it does not matter. this_cpu_ptr gives
> > you additional checks.
>
> Yes, you're right.  The naming scheme in percpu sucks really hard.
> The subtle differences among [__]get_cpu_var(), [__]this_cpu_ptr() and
> other this_cpu ops.  Arghhhhhh.......

Yeah. __this_cpu_ptr is safe to use in preempt / irq disable sections
though the same way as __this_cpu_add/dec etc.

(__)get_cpu_var can be mostly gotten rid off through __this_cpu
operations.

We could define __get_cpu_var and get_cpu_var using this_cpu

#define get_cpu_var(x) (get_cpu(); this_cpu_read(per_cpu_var(x))

#define __get_cpu_var __this_cpu_read(per_cpu_var(x))

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

end of thread, other threads:[~2009-10-13 15:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13  3:48 linux-next: percpu tree build failure Stephen Rothwell
2009-10-13 14:29 ` [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c Tejun Heo
2009-10-13 14:36   ` Christoph Lameter
2009-10-13 14:47     ` Tejun Heo
2009-10-13 14:45       ` Christoph Lameter
2009-10-13 14:57         ` Tejun Heo
2009-10-13 15:14           ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox