Skip to content

Commit 1aabd67

Browse files
torbenh33KAGA-KOKO
authored andcommitted
ia64: Switch do_timer() to xtime_update()
local_cpu_data->itm_next = new_itm; does not need to be protected by xtime_lock. xtime_update() takes the lock itself. Signed-off-by: Torben Hohn <torbenh@gmx.de> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: johnstul@us.ibm.com Cc: hch@infradead.org Cc: yong.zhang0@gmail.com LKML-Reference: <20110127145956.23248.49107.stgit@localhost> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent daad8b5 commit 1aabd67

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

‎arch/ia64/kernel/time.c‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,10 @@ timer_interrupt (int irq, void *dev_id)
190190

191191
new_itm += local_cpu_data->itm_delta;
192192

193-
if (smp_processor_id() == time_keeper_id) {
194-
/*
195-
* Here we are in the timer irq handler. We have irqs locally
196-
* disabled, but we don't know if the timer_bh is running on
197-
* another CPU. We need to avoid to SMP race by acquiring the
198-
* xtime_lock.
199-
*/
200-
write_seqlock(&xtime_lock);
201-
do_timer(1);
202-
local_cpu_data->itm_next = new_itm;
203-
write_sequnlock(&xtime_lock);
204-
} else
205-
local_cpu_data->itm_next = new_itm;
193+
if (smp_processor_id() == time_keeper_id)
194+
xtime_update(1);
195+
196+
local_cpu_data->itm_next = new_itm;
206197

207198
if (time_after(new_itm, ia64_get_itc()))
208199
break;
@@ -222,7 +213,7 @@ timer_interrupt (int irq, void *dev_id)
222213
* comfort, we increase the safety margin by
223214
* intentionally dropping the next tick(s). We do NOT
224215
* update itm.next because that would force us to call
225-
* do_timer() which in turn would let our clock run
216+
* xtime_update() which in turn would let our clock run
226217
* too fast (with the potentially devastating effect
227218
* of losing monotony of time).
228219
*/

‎arch/ia64/xen/time.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,11 @@ consider_steal_time(unsigned long new_itm)
139139
run_posix_cpu_timers(p);
140140
delta_itm += local_cpu_data->itm_delta * (stolen + blocked);
141141

142-
if (cpu == time_keeper_id) {
143-
write_seqlock(&xtime_lock);
144-
do_timer(stolen + blocked);
145-
local_cpu_data->itm_next = delta_itm + new_itm;
146-
write_sequnlock(&xtime_lock);
147-
} else {
148-
local_cpu_data->itm_next = delta_itm + new_itm;
149-
}
142+
if (cpu == time_keeper_id)
143+
xtime_update(stolen + blocked);
144+
145+
local_cpu_data->itm_next = delta_itm + new_itm;
146+
150147
per_cpu(xen_stolen_time, cpu) += NS_PER_TICK * stolen;
151148
per_cpu(xen_blocked_time, cpu) += NS_PER_TICK * blocked;
152149
}

0 commit comments

Comments
 (0)