Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72758
b: refs/heads/master
c: 73a2bcb
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Oct 29, 2007
1 parent 5bb5b51 commit e745527
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7402e0361d4472535e07cfca648f2fa81d85cd2
refs/heads/master: 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
3 changes: 2 additions & 1 deletion trunk/fs/proc/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ struct task_struct {
unsigned int rt_priority;
cputime_t utime, stime, utimescaled, stimescaled;
cputime_t gtime;
cputime_t prev_utime;
unsigned long nvcsw, nivcsw; /* context switch counts */
struct timespec start_time; /* monotonic time */
struct timespec real_start_time; /* boot based time */
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
p->gtime = cputime_zero;
p->utimescaled = cputime_zero;
p->stimescaled = cputime_zero;
p->prev_utime = cputime_zero;

#ifdef CONFIG_TASK_XACCT
p->rchar = 0; /* I/O counter: bytes read */
Expand Down

0 comments on commit e745527

Please sign in to comment.