summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2012-09-08 18:07:29 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2012-09-25 15:42:59 +0200
commit9dc16f64e84fea59d6af6bb5da59603b369ff05c (patch)
tree78e8e15457d989bf4cec3e73e2e605de3ee6234f /arch
parent5bf412cd769eb5830fb3716d4b2b222b6a5515ff (diff)
downloadlinux-9dc16f64e84fea59d6af6bb5da59603b369ff05c.tar.bz2
ia64: Reuse system and user vtime accounting functions on task switch
To avoid code duplication. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/kernel/time.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 351df5850309..80ff9acc5edf 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -104,20 +104,15 @@ void vtime_task_switch(struct task_struct *prev)
{
struct thread_info *pi = task_thread_info(prev);
struct thread_info *ni = task_thread_info(current);
- cputime_t delta_stime;
- __u64 now;
-
- now = ia64_get_itc();
- delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp));
if (idle_task(smp_processor_id()) != prev)
- account_system_time(prev, 0, delta_stime, delta_stime);
+ vtime_account_system(prev);
else
- account_idle_time(delta_stime);
+ vtime_account_idle(prev);
vtime_account_user(prev);
- pi->ac_stamp = ni->ac_stamp = now;
+ pi->ac_stamp = ni->ac_stamp;
ni->ac_stime = ni->ac_utime = 0;
}