Commit 01ea1cca authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

perf_counter: more barrier in blank weak function

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: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e44aef58
...@@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter) ...@@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter)
} }
u64 __weak hw_perf_save_disable(void) { return 0; } u64 __weak hw_perf_save_disable(void) { return 0; }
void __weak hw_perf_restore(u64 ctrl) { } void __weak hw_perf_restore(u64 ctrl) { barrier(); }
void __weak hw_perf_counter_setup(void) { } void __weak hw_perf_counter_setup(void) { barrier(); }
static void static void
list_add_counter(struct perf_counter *counter, struct perf_counter_context *ctx) list_add_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment