[S390] Fix timeval regression on s390

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, February 19, 2009 - 11:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d5cd03...
Commit:     d5cd0343d2878b66e25e044f644563c6bf708833
Parent:     e2e5a0f2b100a5204d27def8bbf73333d1710be2
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Thu Feb 19 15:19:00 2009 +0100
Committer:  Martin Schwidefsky <schwidefsky@de.ibm.com>
CommitDate: Thu Feb 19 15:19:19 2009 +0100

    [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>
---
 arch/s390/include/asm/cputime.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 5217264..95b0f7d 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -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
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[S390] Fix timeval regression on s390, Linux Kernel Mailing ..., (Thu Feb 19, 11:59 am)