Skip to content

Commit

Permalink
[S390] Fix timeval regression on s390
Browse files Browse the repository at this point in the history
commit aa5e97c
[PATCH] improve precision of process accounting.

Introduced a timing regression:
-bash-3.2# time ls
real    0m0.006s
user    0m1.754s
sys     0m1.094s

The problem was introduced by an error in cputime_to_timeval.
Cputime is now 1/4096 microsecond, therefore, we have to divide
the remainder with 4096 to get the microseconds.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Christian Borntraeger authored and Martin Schwidefsky committed Feb 19, 2009
1 parent e2e5a0f commit d5cd034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value)
value->tv_usec = rp.subreg.even / 4096;
value->tv_sec = rp.subreg.odd;
#else
value->tv_usec = cputime % 4096000000ULL;
value->tv_usec = (cputime % 4096000000ULL) / 4096;
value->tv_sec = cputime / 4096000000ULL;
#endif
}
Expand Down

0 comments on commit d5cd034

Please sign in to comment.