Commit a2b0ae25 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

sched/cpuacct: No need to check subsys active state

Now we're guaranteed when cpuacct_charge() and
cpuacct_account_field() are called, cpuacct has already been
properly initialized, so we no longer need those checks.
Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/5155384C.7000508@huawei.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 621e2de0
...@@ -247,9 +247,6 @@ void cpuacct_charge(struct task_struct *tsk, u64 cputime) ...@@ -247,9 +247,6 @@ void cpuacct_charge(struct task_struct *tsk, u64 cputime)
struct cpuacct *ca; struct cpuacct *ca;
int cpu; int cpu;
if (unlikely(!cpuacct_subsys.active))
return;
cpu = task_cpu(tsk); cpu = task_cpu(tsk);
rcu_read_lock(); rcu_read_lock();
...@@ -278,9 +275,6 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val) ...@@ -278,9 +275,6 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val)
struct kernel_cpustat *kcpustat; struct kernel_cpustat *kcpustat;
struct cpuacct *ca; struct cpuacct *ca;
if (unlikely(!cpuacct_subsys.active))
return;
rcu_read_lock(); rcu_read_lock();
ca = task_ca(p); ca = task_ca(p);
while (ca != &root_cpuacct) { while (ca != &root_cpuacct) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment