[sched/core] cpuacct_charge() problem
From: Pavel V. Panteleev
Date: Thu Nov 09 2017 - 09:52:38 EST
Hello!
task_pt_regs() always show on the user regs for user thread, even if
it's working in kernel mode now. So, index calculation in
cpuacct_charge() isn't correct and it's always CPUACCT_STAT_USER for
user thread. The time, spent in kernel mode for user task, will be lost:
int index = CPUACCT_STAT_SYSTEM;
struct pt_regs *regs = task_pt_regs(tsk);
if (regs && user_mode(regs))
index = CPUACCT_STAT_USER;