diff options
Diffstat (limited to 'arch/ia64/kernel/time.c')
-rw-r--r-- | arch/ia64/kernel/time.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 4ee367817049..f0ebb342409d 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c | |||
@@ -93,7 +93,10 @@ void ia64_account_on_switch(struct task_struct *prev, struct task_struct *next) | |||
93 | now = ia64_get_itc(); | 93 | now = ia64_get_itc(); |
94 | 94 | ||
95 | delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp)); | 95 | delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp)); |
96 | account_system_time(prev, 0, delta_stime, delta_stime); | 96 | if (idle_task(smp_processor_id()) != prev) |
97 | account_system_time(prev, 0, delta_stime, delta_stime); | ||
98 | else | ||
99 | account_idle_time(delta_stime); | ||
97 | 100 | ||
98 | if (pi->ac_utime) { | 101 | if (pi->ac_utime) { |
99 | delta_utime = cycle_to_cputime(pi->ac_utime); | 102 | delta_utime = cycle_to_cputime(pi->ac_utime); |
@@ -120,7 +123,10 @@ void account_system_vtime(struct task_struct *tsk) | |||
120 | now = ia64_get_itc(); | 123 | now = ia64_get_itc(); |
121 | 124 | ||
122 | delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); | 125 | delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); |
123 | account_system_time(tsk, 0, delta_stime, delta_stime); | 126 | if (irq_count() || idle_task(smp_processor_id()) != tsk) |
127 | account_system_time(tsk, 0, delta_stime, delta_stime); | ||
128 | else | ||
129 | account_idle_time(delta_stime); | ||
124 | ti->ac_stime = 0; | 130 | ti->ac_stime = 0; |
125 | 131 | ||
126 | ti->ac_stamp = now; | 132 | ti->ac_stamp = now; |