From 06b8e878a9bc9301201cffe186eba99c4185f20a Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 6 Feb 2008 01:36:12 -0800 Subject: taskstats scaled time cleanup This moves the ability to scale cputime into generic code. This allows us to fix the issue in kernel/timer.c (noticed by Balbir) where we could only add an unscaled value to the scaled utime/stime. This adds a cputime_to_scaled function. As before, the POWERPC version does the scaling based on the last SPURR/PURR ratio calculated. The generic and s390 (only other arch to implement asm/cputime.h) versions are both NOPs. Also moves the SPURR and PURR snapshots closer. Signed-off-by: Michael Neuling Cc: Jay Lan Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Heiko Carstens Cc: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/cputime.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/asm-s390') diff --git a/include/asm-s390/cputime.h b/include/asm-s390/cputime.h index 4b3ef7cad11..133ce054fc8 100644 --- a/include/asm-s390/cputime.h +++ b/include/asm-s390/cputime.h @@ -54,6 +54,7 @@ __div(unsigned long long n, unsigned int base) #define cputime_lt(__a, __b) ((__a) < (__b)) #define cputime_le(__a, __b) ((__a) <= (__b)) #define cputime_to_jiffies(__ct) (__div((__ct), 1000000 / HZ)) +#define cputime_to_scaled(__ct) (__ct) #define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (1000000 / HZ)) #define cputime64_zero (0ULL) -- cgit v1.2.3