Skip to content

Commit

Permalink
ia64: Convert vtime to use nsec units directly
Browse files Browse the repository at this point in the history
There is no need anymore for this cputime_t midlayer. Let's use nsec
units directly.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Stanislaw Gruszka <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Wanpeng Li <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
fweisbec authored and Ingo Molnar committed Feb 1, 2017
1 parent 4c56252 commit e2339a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions arch/ia64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ GLOBAL_ENTRY(ia64_native_sched_clock)
END(ia64_native_sched_clock)

#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
GLOBAL_ENTRY(cycle_to_cputime)
GLOBAL_ENTRY(cycle_to_nsec)
alloc r16=ar.pfs,1,0,0,0
addl r8=THIS_CPU(ia64_cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
;;
Expand All @@ -1047,7 +1047,7 @@ GLOBAL_ENTRY(cycle_to_cputime)
;;
shrp r8=r9,r8,IA64_NSEC_PER_CYC_SHIFT
br.ret.sptk.many rp
END(cycle_to_cputime)
END(cycle_to_nsec)
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */

#ifdef CONFIG_IA64_BRL_EMU
Expand Down
14 changes: 7 additions & 7 deletions arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,34 @@ static struct clocksource *itc_clocksource;

#include <linux/kernel_stat.h>

extern cputime_t cycle_to_cputime(u64 cyc);
extern u64 cycle_to_nsec(u64 cyc);

void vtime_flush(struct task_struct *tsk)
{
struct thread_info *ti = task_thread_info(tsk);
u64 delta;

if (ti->utime)
account_user_time(tsk, cputime_to_nsecs(cycle_to_cputime(ti->utime)));
account_user_time(tsk, cycle_to_nsec(ti->utime));

if (ti->gtime)
account_guest_time(tsk, cputime_to_nsecs(cycle_to_cputime(ti->gtime)));
account_guest_time(tsk, cycle_to_nsec(ti->gtime));

if (ti->idle_time)
account_idle_time(cputime_to_nsecs(cycle_to_cputime(ti->idle_time)));
account_idle_time(cycle_to_nsec(ti->idle_time));

if (ti->stime) {
delta = cputime_to_nsecs(cycle_to_cputime(ti->stime));
delta = cycle_to_nsec(ti->stime);
account_system_index_time(tsk, delta, CPUTIME_SYSTEM);
}

if (ti->hardirq_time) {
delta = cputime_to_nsecs(cycle_to_cputime(ti->hardirq_time));
delta = cycle_to_nsec(ti->hardirq_time);
account_system_index_time(tsk, delta, CPUTIME_IRQ);
}

if (ti->softirq_time) {
delta = cputime_to_nsecs(cycle_to_cputime(ti->softirq_time));
delta = cycle_to_nsec(ti->softirq_time));
account_system_index_time(tsk, delta, CPUTIME_SOFTIRQ);
}

Expand Down

0 comments on commit e2339a4

Please sign in to comment.