diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-29 16:18:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-29 16:18:11 -0400 |
commit | 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee (patch) | |
tree | dd84f61589c7dd21b7be973c288611ffe547f21b /fs/proc | |
parent | f7402e0361d4472535e07cfca648f2fa81d85cd2 (diff) |
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>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/array.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 63c95afb561f..d80baaabf835 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -358,7 +358,8 @@ static cputime_t task_utime(struct task_struct *p) | |||
358 | } | 358 | } |
359 | utime = (clock_t)temp; | 359 | utime = (clock_t)temp; |
360 | 360 | ||
361 | return clock_t_to_cputime(utime); | 361 | p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime)); |
362 | return p->prev_utime; | ||
362 | } | 363 | } |
363 | 364 | ||
364 | static cputime_t task_stime(struct task_struct *p) | 365 | static cputime_t task_stime(struct task_struct *p) |