sched/cpuacct: Use __this_cpu_add() instead of this_cpu_ptr()
authorMuchun Song <songmuchun@bytedance.com>
Thu, 7 May 2020 03:10:39 +0000 (11:10 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 19 May 2020 18:34:13 +0000 (20:34 +0200)
commit12aa2587388de6697fd2e585ae6a90f70249540b
tree88a90b936c5f995ee9938cde7c6f875769f4e567
parent7d148be69e3a0eaa9d029a3c51b545e322116a99
sched/cpuacct: Use __this_cpu_add() instead of this_cpu_ptr()

The cpuacct_charge() and cpuacct_account_field() are called with
rq->lock held, and this means preemption(and IRQs) are indeed
disabled, so it is safe to use __this_cpu_*() to allow for better
code-generation.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200507031039.32615-1-songmuchun@bytedance.com
kernel/sched/cpuacct.c