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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user