Skip to content

Commit a2b0ae2

Browse files
lizf-osingomolnar
authored andcommitted
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: Li Zefan <lizefan@huawei.com> Cc: Tejun Heo <tj@kernel.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/5155384C.7000508@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 621e2de commit a2b0ae2

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎kernel/sched/cpuacct.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,6 @@ void cpuacct_charge(struct task_struct *tsk, u64 cputime)
247247
struct cpuacct *ca;
248248
int cpu;
249249

250-
if (unlikely(!cpuacct_subsys.active))
251-
return;
252-
253250
cpu = task_cpu(tsk);
254251

255252
rcu_read_lock();
@@ -278,9 +275,6 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val)
278275
struct kernel_cpustat *kcpustat;
279276
struct cpuacct *ca;
280277

281-
if (unlikely(!cpuacct_subsys.active))
282-
return;
283-
284278
rcu_read_lock();
285279
ca = task_ca(p);
286280
while (ca != &root_cpuacct) {

0 commit comments

Comments
 (0)