diff options
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 63c95afb561f..65c62e1bfd6f 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) |
@@ -373,7 +374,10 @@ static cputime_t task_stime(struct task_struct *p) | |||
373 | stime = nsec_to_clock_t(p->se.sum_exec_runtime) - | 374 | stime = nsec_to_clock_t(p->se.sum_exec_runtime) - |
374 | cputime_to_clock_t(task_utime(p)); | 375 | cputime_to_clock_t(task_utime(p)); |
375 | 376 | ||
376 | return clock_t_to_cputime(stime); | 377 | if (stime >= 0) |
378 | p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime)); | ||
379 | |||
380 | return p->prev_stime; | ||
377 | } | 381 | } |
378 | #endif | 382 | #endif |
379 | 383 | ||