sched/cpuacct: Add cpuacct_init()

So we don't open-coded initialization of cpuacct in core.c.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51553687.1060906@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Li Zefan
2013-03-29 14:36:55 +08:00
committed by Ingo Molnar
parent 60fed7891d
commit dbe4b41f98
3 changed files with 14 additions and 6 deletions

View File

@@ -6936,12 +6936,8 @@ void __init sched_init(void)
#endif /* CONFIG_CGROUP_SCHED */
#ifdef CONFIG_CGROUP_CPUACCT
root_cpuacct.cpustat = &kernel_cpustat;
root_cpuacct.cpuusage = alloc_percpu(u64);
/* Too early, not expected to fail */
BUG_ON(!root_cpuacct.cpuusage);
#endif
cpuacct_init();
for_each_possible_cpu(i) {
struct rq *rq;