Skip to content

Commit

Permalink
sched/cpuacct: Initialize cpuacct subsystem earlier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Apr 10, 2013
1 parent 14c6d3c commit 621e2de
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions kernel/sched/cpuacct.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val)
}

struct cgroup_subsys cpuacct_subsys = {
.name = "cpuacct",
.css_alloc = cpuacct_css_alloc,
.css_free = cpuacct_css_free,
.subsys_id = cpuacct_subsys_id,
.base_cftypes = files,
.name = "cpuacct",
.css_alloc = cpuacct_css_alloc,
.css_free = cpuacct_css_free,
.subsys_id = cpuacct_subsys_id,
.base_cftypes = files,
.early_init = 1,
};

0 comments on commit 621e2de

Please sign in to comment.