diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2016-03-17 12:19:43 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-03-21 11:00:28 +0100 |
commit | 73e6aafd9ea81498d31361f01db84a0118da2d1c (patch) | |
tree | bd2a3300424d7a9c54a9caf3ee2eb44bbd4e5e12 /kernel/sched/cpuacct.h | |
parent | 1a736b77a3f50910843d076623204ba6e5057dc1 (diff) | |
download | blackbird-op-linux-73e6aafd9ea81498d31361f01db84a0118da2d1c.tar.gz blackbird-op-linux-73e6aafd9ea81498d31361f01db84a0118da2d1c.zip |
sched/cpuacct: Simplify the cpuacct code
- Use for() instead of while() loop in some functions
to make the code simpler.
- Use this_cpu_ptr() instead of per_cpu_ptr() to make the code
cleaner and a bit faster.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/d8a7ef9592f55224630cb26dea239f05b6398a4e.1458187654.git.zhaolei@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cpuacct.h')
-rw-r--r-- | kernel/sched/cpuacct.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/cpuacct.h b/kernel/sched/cpuacct.h index ed605624a5e7..ba72807c73d4 100644 --- a/kernel/sched/cpuacct.h +++ b/kernel/sched/cpuacct.h @@ -1,7 +1,7 @@ #ifdef CONFIG_CGROUP_CPUACCT extern void cpuacct_charge(struct task_struct *tsk, u64 cputime); -extern void cpuacct_account_field(struct task_struct *p, int index, u64 val); +extern void cpuacct_account_field(struct task_struct *tsk, int index, u64 val); #else @@ -10,7 +10,7 @@ static inline void cpuacct_charge(struct task_struct *tsk, u64 cputime) } static inline void -cpuacct_account_field(struct task_struct *p, int index, u64 val) +cpuacct_account_field(struct task_struct *tsk, int index, u64 val) { } |