diff options
author | Li Zefan <lizefan@huawei.com> | 2013-03-29 02:44:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-10 07:54:21 -0400 |
commit | 621e2de02403a6f776852c564b79c38bf3cc9032 (patch) | |
tree | ecf275fcd1ae888a0655f271faffa20c32c4710d /kernel | |
parent | 14c6d3c8a47ced185b6375c4940b5b393f1a294e (diff) |
sched/cpuacct: Initialize cpuacct subsystem earlier
Initialize cpuacct before the scheduler is functioning, so when
cpuacct_charge() and cpuacct_account_field() are called,
task_ca() won't return NULL.
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/5155383F.8000005@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/cpuacct.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 04255814a0ed..75e46d291f9c 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c | |||
@@ -292,9 +292,10 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val) | |||
292 | } | 292 | } |
293 | 293 | ||
294 | struct cgroup_subsys cpuacct_subsys = { | 294 | struct cgroup_subsys cpuacct_subsys = { |
295 | .name = "cpuacct", | 295 | .name = "cpuacct", |
296 | .css_alloc = cpuacct_css_alloc, | 296 | .css_alloc = cpuacct_css_alloc, |
297 | .css_free = cpuacct_css_free, | 297 | .css_free = cpuacct_css_free, |
298 | .subsys_id = cpuacct_subsys_id, | 298 | .subsys_id = cpuacct_subsys_id, |
299 | .base_cftypes = files, | 299 | .base_cftypes = files, |
300 | .early_init = 1, | ||
300 | }; | 301 | }; |