diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-04 13:13:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-04 13:30:32 -0400 |
commit | 0d905bca23aca5c86a10ee101bcd3b1abbd40b25 (patch) | |
tree | 5a4e6b956d1923ac1d28ae8b8f3034c1c90df5a5 /include/linux | |
parent | ba77813a2a22d631fe5bc0bf1ec0d11350544b70 (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 'include/linux')
-rw-r--r-- | include/linux/perf_counter.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index f776851f8c4b..a356fa69796c 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -573,6 +573,8 @@ extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | |||
573 | 573 | ||
574 | extern int sysctl_perf_counter_priv; | 574 | extern int sysctl_perf_counter_priv; |
575 | 575 | ||
576 | extern void perf_counter_init(void); | ||
577 | |||
576 | #else | 578 | #else |
577 | static inline void | 579 | static inline void |
578 | perf_counter_task_sched_in(struct task_struct *task, int cpu) { } | 580 | perf_counter_task_sched_in(struct task_struct *task, int cpu) { } |
@@ -600,9 +602,10 @@ perf_counter_mmap(unsigned long addr, unsigned long len, | |||
600 | 602 | ||
601 | static inline void | 603 | static inline void |
602 | perf_counter_munmap(unsigned long addr, unsigned long len, | 604 | perf_counter_munmap(unsigned long addr, unsigned long len, |
603 | unsigned long pgoff, struct file *file) { } | 605 | unsigned long pgoff, struct file *file) { } |
604 | 606 | ||
605 | static inline void perf_counter_comm(struct task_struct *tsk) { } | 607 | static inline void perf_counter_comm(struct task_struct *tsk) { } |
608 | static inline void perf_counter_init(void) { } | ||
606 | #endif | 609 | #endif |
607 | 610 | ||
608 | #endif /* __KERNEL__ */ | 611 | #endif /* __KERNEL__ */ |