]> git.baikalelectronics.ru Git - kernel.git/commit
sched/cpuacct: Fix charge cpuacct.usage_sys
authorMuchun Song <songmuchun@bytedance.com>
Mon, 20 Apr 2020 07:04:53 +0000 (15:04 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 19 May 2020 18:34:14 +0000 (20:34 +0200)
commit857cbfc6dd3fc22c5500b3f9c5ce4d261f7cf682
tree7b5079a3ac04d5b5d3933b672e9ff93fef1a495d
parent4334c4185fda1c20a182e2fd4f7465321b418da1
sched/cpuacct: Fix charge cpuacct.usage_sys

The user_mode(task_pt_regs(tsk)) always return true for
user thread, and false for kernel thread. So it means that
the cpuacct.usage_sys is the time that kernel thread uses
not the time that thread uses in the kernel mode. We can
try get_irq_regs() first, if it is NULL, then we can fall
back to task_pt_regs().

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