#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;
rcu_read_unlock();
}
+void __init cpuacct_init(void)
+{
+ root_cpuacct.cpustat = &kernel_cpustat;
+ root_cpuacct.cpuusage = alloc_percpu(u64);
+ BUG_ON(!root_cpuacct.cpuusage); /* Too early, not expected to fail */
+}
+
struct cgroup_subsys cpuacct_subsys = {
.name = "cpuacct",
.css_alloc = cpuacct_css_alloc,
return cgroup_ca(ca->css.cgroup->parent);
}
+extern void cpuacct_init(void);
extern void cpuacct_charge(struct task_struct *tsk, u64 cputime);
#else
+static inline void cpuacct_init(void)
+{
+}
+
static inline void cpuacct_charge(struct task_struct *tsk, u64 cputime)
{
}