aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r--arch/powerpc/kernel/time.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 5cd3db5cae41..3b26fbd6bec9 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -66,6 +66,7 @@
66#include <asm/smp.h> 66#include <asm/smp.h>
67#include <asm/vdso_datapage.h> 67#include <asm/vdso_datapage.h>
68#include <asm/firmware.h> 68#include <asm/firmware.h>
69#include <asm/cputime.h>
69#ifdef CONFIG_PPC_ISERIES 70#ifdef CONFIG_PPC_ISERIES
70#include <asm/iseries/it_lp_queue.h> 71#include <asm/iseries/it_lp_queue.h>
71#include <asm/iseries/hv_call_xm.h> 72#include <asm/iseries/hv_call_xm.h>
@@ -189,6 +190,8 @@ u64 __cputime_sec_factor;
189EXPORT_SYMBOL(__cputime_sec_factor); 190EXPORT_SYMBOL(__cputime_sec_factor);
190u64 __cputime_clockt_factor; 191u64 __cputime_clockt_factor;
191EXPORT_SYMBOL(__cputime_clockt_factor); 192EXPORT_SYMBOL(__cputime_clockt_factor);
193DEFINE_PER_CPU(unsigned long, cputime_last_delta);
194DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
192 195
193static void calc_cputime_factors(void) 196static void calc_cputime_factors(void)
194{ 197{
@@ -257,8 +260,8 @@ void account_system_vtime(struct task_struct *tsk)
257 } 260 }
258 account_system_time(tsk, 0, delta); 261 account_system_time(tsk, 0, delta);
259 account_system_time_scaled(tsk, deltascaled); 262 account_system_time_scaled(tsk, deltascaled);
260 get_paca()->purrdelta = delta; 263 per_cpu(cputime_last_delta, smp_processor_id()) = delta;
261 get_paca()->spurrdelta = deltascaled; 264 per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
262 local_irq_restore(flags); 265 local_irq_restore(flags);
263} 266}
264 267
@@ -276,10 +279,7 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
276 get_paca()->user_time = 0; 279 get_paca()->user_time = 0;
277 account_user_time(tsk, utime); 280 account_user_time(tsk, utime);
278 281
279 /* Estimate the scaled utime by scaling the real utime based 282 utimescaled = cputime_to_scaled(utime);
280 * on the last spurr to purr ratio */
281 utimescaled = utime * get_paca()->spurrdelta / get_paca()->purrdelta;
282 get_paca()->spurrdelta = get_paca()->purrdelta = 0;
283 account_user_time_scaled(tsk, utimescaled); 283 account_user_time_scaled(tsk, utimescaled);
284} 284}
285 285