Permalink
Browse files

ck: revert time accounting "fix" that produced time anomalies with 'ps'

  • Loading branch information...
1 parent 9e03ec6 commit d4ea811726fd0aaa88311bcbe5b8cec5cd06c794 @damentz damentz committed Dec 29, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 kernel/sched/bfs.c
View
@@ -7491,9 +7491,9 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
rtime = nsecs_to_cputime(p->sched_time);
if (total) {
- u64 temp = rtime;
+ u64 temp;
- temp *= utime;
+ temp = (u64)(rtime * utime);
do_div(temp, total);
utime = (cputime_t)temp;
} else
@@ -7524,9 +7524,9 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
if (total) {
- u64 temp = rtime;
+ u64 temp;
- temp *= cputime.utime;
+ temp = (u64)(rtime * cputime.utime);
do_div(temp, total);
utime = (cputime_t)temp;
} else

0 comments on commit d4ea811

Please sign in to comment.