Skip to contentSkip to conversation

linux-next: percpu tree build failure

PATCH In review Stephen Rothwell 3 participants 7 messages Oct 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw

PATCH 1/1 this_cpu: Use this_cpu_xx in trace_functions_graph.c

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.

---
This patch has been committed to percpu#for-next. Thanks.

 kernel/trace/trace_functions_graph.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_functions_graph.c +2 -2
index 45e6c01..90a6daa 100644
@@ -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,
Signature · 1 line
1.6.4.2
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

Quoted 3 lines · Tejun Heo

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.

#3 lore raw

Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

Quoted 9 lines · Christoph Lameter
Quoted 3 lines · Tejun Heo

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.

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.

Signature · 1 line
tejun
#4 lore raw

Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

Quoted 4 lines · Tejun Heo

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.

#5 lore raw

Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

Quoted 7 lines · Christoph Lameter
Quoted 4 lines · Tejun Heo

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_*().

Quoted 6 lines

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.......

Signature · 1 line
tejun
#6 lore raw

Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

Quoted 6 lines · Tejun Heo
Quoted 2 lines

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))