Skip to content

Commit

Permalink
ia64: Reuse system and user vtime accounting functions on task switch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker committed Sep 25, 2012
1 parent 5bf412c commit 9dc16f6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9dc16f6

Please sign in to comment.