aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-04 13:13:30 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-04 13:30:32 -0400
commit0d905bca23aca5c86a10ee101bcd3b1abbd40b25 (patch)
tree5a4e6b956d1923ac1d28ae8b8f3034c1c90df5a5 /kernel/perf_counter.c
parentba77813a2a22d631fe5bc0bf1ec0d11350544b70 (diff)
perf_counter: initialize the per-cpu context earlier
percpu scheduling for perfcounters wants to take the context lock, but that lock first needs to be initialized. Currently it is an early_initcall() - but that is too late, the task tick runs much sooner than that. Call it explicitly from the scheduler init sequence instead. [ Impact: fix access-before-init crash ] LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index b9679c36bcc2..fcdafa234a5d 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -3265,15 +3265,12 @@ static struct notifier_block __cpuinitdata perf_cpu_nb = {
3265 .notifier_call = perf_cpu_notify, 3265 .notifier_call = perf_cpu_notify,
3266}; 3266};
3267 3267
3268static int __init perf_counter_init(void) 3268void __init perf_counter_init(void)
3269{ 3269{
3270 perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE, 3270 perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE,
3271 (void *)(long)smp_processor_id()); 3271 (void *)(long)smp_processor_id());
3272 register_cpu_notifier(&perf_cpu_nb); 3272 register_cpu_notifier(&perf_cpu_nb);
3273
3274 return 0;
3275} 3273}
3276early_initcall(perf_counter_init);
3277 3274
3278static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf) 3275static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf)
3279{ 3276{