diff options
author | Li Zefan <lizefan@huawei.com> | 2013-03-29 14:37:06 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-10 13:54:17 +0200 |
commit | 1966aaf7d54608e8ddb7ac454b461840e763409a (patch) | |
tree | 01010d8ff23842f4200e69d2955fd805f50d6e28 /kernel/sched/cputime.c | |
parent | dbe4b41f9800223949ce72e4289814697e0ea91a (diff) | |
download | kernel_goldelico_gta04-1966aaf7d54608e8ddb7ac454b461840e763409a.zip kernel_goldelico_gta04-1966aaf7d54608e8ddb7ac454b461840e763409a.tar.gz kernel_goldelico_gta04-1966aaf7d54608e8ddb7ac454b461840e763409a.tar.bz2 |
sched/cpuacct: Add cpuacct_acount_field()
So we can remove open-coded cpuacct code in cputime.c.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51553692.9060008@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cputime.c')
-rw-r--r-- | kernel/sched/cputime.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 699d597..33508dc 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -115,10 +115,6 @@ static int irqtime_account_si_update(void) static inline void task_group_account_field(struct task_struct *p, int index, u64 tmp) { -#ifdef CONFIG_CGROUP_CPUACCT - struct kernel_cpustat *kcpustat; - struct cpuacct *ca; -#endif /* * Since all updates are sure to touch the root cgroup, we * get ourselves ahead and touch it first. If the root cgroup @@ -127,19 +123,7 @@ static inline void task_group_account_field(struct task_struct *p, int index, */ __get_cpu_var(kernel_cpustat).cpustat[index] += tmp; -#ifdef CONFIG_CGROUP_CPUACCT - if (unlikely(!cpuacct_subsys.active)) - return; - - rcu_read_lock(); - ca = task_ca(p); - while (ca && (ca != &root_cpuacct)) { - kcpustat = this_cpu_ptr(ca->cpustat); - kcpustat->cpustat[index] += tmp; - ca = parent_ca(ca); - } - rcu_read_unlock(); -#endif + cpuacct_account_field(p, index, tmp); } /* |