Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] Fix timeval regression on s390

commit aa5e97ce4bbc9d5daeec16b1d15bb3f6b7b4f4d4
[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>

authored by

Christian Borntraeger and committed by
Martin Schwidefsky
d5cd0343 e2e5a0f2

+1 -1
+1 -1
arch/s390/include/asm/cputime.h
··· 145 145 value->tv_usec = rp.subreg.even / 4096; 146 146 value->tv_sec = rp.subreg.odd; 147 147 #else 148 - value->tv_usec = cputime % 4096000000ULL; 148 + value->tv_usec = (cputime % 4096000000ULL) / 4096; 149 149 value->tv_sec = cputime / 4096000000ULL; 150 150 #endif 151 151 }