perf_counter: more barrier in blank weak function
authorYinghai Lu <yinghai@kernel.org>
Sat, 27 Dec 2008 05:05:06 +0000 (21:05 -0800)
committerIngo Molnar <mingo@elte.hu>
Sat, 27 Dec 2008 10:58:48 +0000 (11:58 +0100)
Impact: fix panic possible panic

Some versions of GCC inline the weak global function if it's empty.
Add a barrier() to work it around.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c

index d7a79f321b1c3c497d346c4a6b944780aac21c2e..37f771691f938b84eaa9126fc6f387d9a9356424 100644 (file)
@@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter)
 }
 
 u64 __weak hw_perf_save_disable(void)          { return 0; }
-void __weak hw_perf_restore(u64 ctrl)          { }
-void __weak hw_perf_counter_setup(void)                { }
+void __weak hw_perf_restore(u64 ctrl)          { barrier(); }
+void __weak hw_perf_counter_setup(void)                { barrier(); }
 
 static void
 list_add_counter(struct perf_counter *counter, struct perf_counter_context *ctx)