From 4c4bcc55a49ebb668a308e88605718f5f2870d5d Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 4 May 2009 19:13:30 +0200 Subject: [PATCH] --- yaml --- r: 147426 b: refs/heads/master c: 0d905bca23aca5c86a10ee101bcd3b1abbd40b25 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/perf_counter.h | 5 ++++- trunk/kernel/perf_counter.c | 5 +---- trunk/kernel/sched.c | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index cf0e58c97e0a..f18002f03404 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ba77813a2a22d631fe5bc0bf1ec0d11350544b70 +refs/heads/master: 0d905bca23aca5c86a10ee101bcd3b1abbd40b25 diff --git a/trunk/include/linux/perf_counter.h b/trunk/include/linux/perf_counter.h index f776851f8c4b..a356fa69796c 100644 --- a/trunk/include/linux/perf_counter.h +++ b/trunk/include/linux/perf_counter.h @@ -573,6 +573,8 @@ extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); extern int sysctl_perf_counter_priv; +extern void perf_counter_init(void); + #else static inline void perf_counter_task_sched_in(struct task_struct *task, int cpu) { } @@ -600,9 +602,10 @@ perf_counter_mmap(unsigned long addr, unsigned long len, static inline void perf_counter_munmap(unsigned long addr, unsigned long len, - unsigned long pgoff, struct file *file) { } + unsigned long pgoff, struct file *file) { } static inline void perf_counter_comm(struct task_struct *tsk) { } +static inline void perf_counter_init(void) { } #endif #endif /* __KERNEL__ */ diff --git a/trunk/kernel/perf_counter.c b/trunk/kernel/perf_counter.c index b9679c36bcc2..fcdafa234a5d 100644 --- a/trunk/kernel/perf_counter.c +++ b/trunk/kernel/perf_counter.c @@ -3265,15 +3265,12 @@ static struct notifier_block __cpuinitdata perf_cpu_nb = { .notifier_call = perf_cpu_notify, }; -static int __init perf_counter_init(void) +void __init perf_counter_init(void) { perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE, (void *)(long)smp_processor_id()); register_cpu_notifier(&perf_cpu_nb); - - return 0; } -early_initcall(perf_counter_init); static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf) { diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 2f600e30dcf0..a728976a3a6c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -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; }