aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/time.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2011-12-09 06:35:08 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-12-18 22:41:20 -0500
commit9f5072d4f63f28d30d343573830ac6c85fc0deff (patch)
tree60d0a8dee9620e75c6da87b3ab09813945dec336 /arch/powerpc/kernel/time.c
parent2011b1d0d31ae469c7a075061e03b7d4f5b49ba6 (diff)
powerpc: Fix wrong divisor in usecs_to_cputime
Commit d57af9b (taskstats: use real microsecond granularity for CPU times) renamed msecs_to_cputime to usecs_to_cputime, but failed to update all numbers on the way. This causes nonsensical cpu idle/iowait values to be displayed in /proc/stat (the only user of usecs_to_cputime so far). This also renames __cputime_msec_factor to __cputime_usec_factor, adapting its value and using it directly in cputime_to_usecs instead of doing two multiplications. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Acked-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r--arch/powerpc/kernel/time.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 9754743db8b9..567dd7c3ac2a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -158,13 +158,13 @@ EXPORT_SYMBOL_GPL(ppc_tb_freq);
158#ifdef CONFIG_VIRT_CPU_ACCOUNTING 158#ifdef CONFIG_VIRT_CPU_ACCOUNTING
159/* 159/*
160 * Factors for converting from cputime_t (timebase ticks) to 160 * Factors for converting from cputime_t (timebase ticks) to
161 * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds). 161 * jiffies, microseconds, seconds, and clock_t (1/USER_HZ seconds).
162 * These are all stored as 0.64 fixed-point binary fractions. 162 * These are all stored as 0.64 fixed-point binary fractions.
163 */ 163 */
164u64 __cputime_jiffies_factor; 164u64 __cputime_jiffies_factor;
165EXPORT_SYMBOL(__cputime_jiffies_factor); 165EXPORT_SYMBOL(__cputime_jiffies_factor);
166u64 __cputime_msec_factor; 166u64 __cputime_usec_factor;
167EXPORT_SYMBOL(__cputime_msec_factor); 167EXPORT_SYMBOL(__cputime_usec_factor);
168u64 __cputime_sec_factor; 168u64 __cputime_sec_factor;
169EXPORT_SYMBOL(__cputime_sec_factor); 169EXPORT_SYMBOL(__cputime_sec_factor);
170u64 __cputime_clockt_factor; 170u64 __cputime_clockt_factor;
@@ -182,8 +182,8 @@ static void calc_cputime_factors(void)
182 182
183 div128_by_32(HZ, 0, tb_ticks_per_sec, &res); 183 div128_by_32(HZ, 0, tb_ticks_per_sec, &res);
184 __cputime_jiffies_factor = res.result_low; 184 __cputime_jiffies_factor = res.result_low;
185 div128_by_32(1000, 0, tb_ticks_per_sec, &res); 185 div128_by_32(1000000, 0, tb_ticks_per_sec, &res);
186 __cputime_msec_factor = res.result_low; 186 __cputime_usec_factor = res.result_low;
187 div128_by_32(1, 0, tb_ticks_per_sec, &res); 187 div128_by_32(1, 0, tb_ticks_per_sec, &res);
188 __cputime_sec_factor = res.result_low; 188 __cputime_sec_factor = res.result_low;
189 div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res); 189 div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res);