[PATCH] perf_counter: more barrier in blank weak function
From: Yinghai Lu
Date: Sat Dec 27 2008 - 00:05:06 EST
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@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/perf_counter.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index d7a79f3..37f7716 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/