Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371143
b: refs/heads/master
c: 772c808
h: refs/heads/master
i:
  371141: 5a9f268
  371139: db0d3f7
  371135: 45a20ab
v: v3
  • Loading branch information
Stanislaw Gruszka authored and Ingo Molnar committed Apr 30, 2013
1 parent 513c40e commit 3e07bb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55eaa7c1f511af5fb6ef808b5328804f4d4e5243
refs/heads/master: 772c808a252594692972773f6ee41c289b8e0b2a
9 changes: 9 additions & 0 deletions trunk/kernel/sched/cputime.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,14 @@ static void cputime_adjust(struct task_cputime *curr,
*/
rtime = nsecs_to_cputime(curr->sum_exec_runtime);

/*
* Update userspace visible utime/stime values only if actual execution
* time is bigger than already exported. Note that can happen, that we
* provided bigger values due to scaling inaccuracy on big numbers.
*/
if (prev->stime + prev->utime >= rtime)
goto out;

if (!rtime) {
stime = 0;
} else if (!total) {
Expand All @@ -598,6 +606,7 @@ static void cputime_adjust(struct task_cputime *curr,
prev->stime = max(prev->stime, stime);
prev->utime = max(prev->utime, rtime - prev->stime);

out:
*ut = prev->utime;
*st = prev->stime;
}
Expand Down

0 comments on commit 3e07bb5

Please sign in to comment.