mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][PPC32] Optimize/fix timer_interrupt loop
@ 2004-08-09 15:11 Matt Porter
  0 siblings, 0 replies; only message in thread
From: Matt Porter @ 2004-08-09 15:11 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linuxppc-dev

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: Matt Porter <mporter@kernel.crashing.org>

===== arch/ppc/kernel/time.c 1.29 vs edited =====
--- 1.29/arch/ppc/kernel/time.c	Tue Jun 22 12:05:08 2004
+++ edited/arch/ppc/kernel/time.c	Tue Aug  3 13:32:22 2004
@@ -161,7 +161,7 @@
 
 	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;
 		
 		ppc_do_profile(regs);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-09 15:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 15:11 [PATCH][PPC32] Optimize/fix timer_interrupt loop Matt Porter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®