lkml.org 
[lkml]   [2004]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[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: 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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.019 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site