aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/time.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 16bb6eda879d..01cd43e491cd 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -116,29 +116,32 @@ void vtime_task_switch(struct task_struct *prev)
116 * Account time for a transition between system, hard irq or soft irq state. 116 * Account time for a transition between system, hard irq or soft irq state.
117 * Note that this function is called with interrupts enabled. 117 * Note that this function is called with interrupts enabled.
118 */ 118 */
119void vtime_account(struct task_struct *tsk) 119static cputime_t vtime_delta(struct task_struct *tsk)
120{ 120{
121 struct thread_info *ti = task_thread_info(tsk); 121 struct thread_info *ti = task_thread_info(tsk);
122 unsigned long flags;
123 cputime_t delta_stime; 122 cputime_t delta_stime;
124 __u64 now; 123 __u64 now;
125 124
126 local_irq_save(flags);
127
128 now = ia64_get_itc(); 125 now = ia64_get_itc();
129 126
130 delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); 127 delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp));
131 if (irq_count() || idle_task(smp_processor_id()) != tsk)
132 account_system_time(tsk, 0, delta_stime, delta_stime);
133 else
134 account_idle_time(delta_stime);
135 ti->ac_stime = 0; 128 ti->ac_stime = 0;
136
137 ti->ac_stamp = now; 129 ti->ac_stamp = now;
138 130
139 local_irq_restore(flags); 131 return delta_stime;
132}
133
134void vtime_account_system(struct task_struct *tsk)
135{
136 cputime_t delta = vtime_delta(tsk);
137
138 account_system_time(tsk, 0, delta, delta);
139}
140
141void vtime_account_idle(struct task_struct *tsk)
142{
143 account_idle_time(vtime_delta(tsk));
140} 144}
141EXPORT_SYMBOL_GPL(vtime_account);
142 145
143/* 146/*
144 * Called from the timer interrupt handler to charge accumulated user time 147 * Called from the timer interrupt handler to charge accumulated user time