Commit 07a134d6 authored by Matt Porter's avatar Matt Porter Committed by Linus Torvalds

[PATCH] ppc32: optimize/fix timer_interrupt loop

The following patch fixes the situation where the loop condition could
generate a next_dec of zero while exiting the loop.  This is suboptimal on
Classic PPC because it forces another interrupt to occur and reenter the
handler.  It is fatal on Book E cores, because their decrementer is stopped
when writing a zero (Classic interrupts on a 0->-1 transition, Book E
interrupts on a 1->0 transition).  Instead, stay in the loop on a
next_dec==0.
Signed-off-by: default avatarMatt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d6e3c04a
...@@ -161,7 +161,7 @@ void timer_interrupt(struct pt_regs * regs) ...@@ -161,7 +161,7 @@ void timer_interrupt(struct pt_regs * regs)
irq_enter(); irq_enter();
while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) < 0) { while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
jiffy_stamp += tb_ticks_per_jiffy; jiffy_stamp += tb_ticks_per_jiffy;
ppc_do_profile(regs); ppc_do_profile(regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment