aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/cpuacct.c
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-03-29 02:43:46 -0400
committerIngo Molnar <mingo@kernel.org>2013-04-10 07:54:20 -0400
commit7943e15a3e91db78a7a3fbc84e45cf9d1c7c7d23 (patch)
tree8710fcd9862d6e5fe8349821b8f903dfbe8bf2c9 /kernel/sched/cpuacct.c
parentd1712796a880bea0a44739941116001923f3275b (diff)
sched/cpuacct: Allocate per_cpu cpuusage for root cpuacct statically
This is a preparation, so later we can initialize cpuacct earlier. Signed-off-by: Li Zefan <lizefan@huawei.com> Cc: Tejun Heo <tj@kernel.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/51553822.5000403@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cpuacct.c')
-rw-r--r--kernel/sched/cpuacct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index 9305fd2f8cf9..a691c4dd65be 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -58,6 +58,7 @@ static inline struct cpuacct *parent_ca(struct cpuacct *ca)
58 return cgroup_ca(ca->css.cgroup->parent); 58 return cgroup_ca(ca->css.cgroup->parent);
59} 59}
60 60
61static DEFINE_PER_CPU(u64, root_cpuacct_cpuusage);
61static struct cpuacct root_cpuacct; 62static struct cpuacct root_cpuacct;
62 63
63/* create a new cpu accounting group */ 64/* create a new cpu accounting group */
@@ -290,8 +291,7 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val)
290void __init cpuacct_init(void) 291void __init cpuacct_init(void)
291{ 292{
292 root_cpuacct.cpustat = &kernel_cpustat; 293 root_cpuacct.cpustat = &kernel_cpustat;
293 root_cpuacct.cpuusage = alloc_percpu(u64); 294 root_cpuacct.cpuusage = &root_cpuacct_cpuusage;
294 BUG_ON(!root_cpuacct.cpuusage); /* Too early, not expected to fail */
295} 295}
296 296
297struct cgroup_subsys cpuacct_subsys = { 297struct cgroup_subsys cpuacct_subsys = {