diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-04 19:13:30 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-04 19:30:32 +0200 |
commit | 0d905bca23aca5c86a10ee101bcd3b1abbd40b25 (patch) | |
tree | 5a4e6b956d1923ac1d28ae8b8f3034c1c90df5a5 /kernel/sched.c | |
parent | ba77813a2a22d631fe5bc0bf1ec0d11350544b70 (diff) | |
download | op-kernel-dev-0d905bca23aca5c86a10ee101bcd3b1abbd40b25.zip op-kernel-dev-0d905bca23aca5c86a10ee101bcd3b1abbd40b25.tar.gz |
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/sched.c')
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 2f600e3..a728976 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -39,6 +39,7 @@ #include <linux/completion.h> #include <linux/kernel_stat.h> #include <linux/debug_locks.h> +#include <linux/perf_counter.h> #include <linux/security.h> #include <linux/notifier.h> #include <linux/profile.h> @@ -8996,7 +8997,7 @@ void __init sched_init(void) * 1024) and two child groups A0 and A1 (of weight 1024 each), * then A0's share of the cpu resource is: * - * A0's bandwidth = 1024 / (10*1024 + 1024 + 1024) = 8.33% + * A0's bandwidth = 1024 / (10*1024 + 1024 + 1024) = 8.33% * * We achieve this by letting init_task_group's tasks sit * directly in rq->cfs (i.e init_task_group->se[] = NULL). @@ -9097,6 +9098,8 @@ void __init sched_init(void) alloc_bootmem_cpumask_var(&cpu_isolated_map); #endif /* SMP */ + perf_counter_init(); + scheduler_running = 1; } |