mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 05:11:46 +00:00
sched: keep utime/stime monotonic
keep utime/stime monotonic. cpustats use utime/stime as a ratio against sum_exec_runtime, as a consequence it can happen - when the ratio changes faster than time accumulates - that either can be appear to go backwards. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
f7402e0361
commit
73a2bcb0ed
3 changed files with 4 additions and 1 deletions
|
@ -358,7 +358,8 @@ static cputime_t task_utime(struct task_struct *p)
|
|||
}
|
||||
utime = (clock_t)temp;
|
||||
|
||||
return clock_t_to_cputime(utime);
|
||||
p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime));
|
||||
return p->prev_utime;
|
||||
}
|
||||
|
||||
static cputime_t task_stime(struct task_struct *p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue