LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch-mm] dynticks: Fix one off jiffy update
@ 2007-01-29 23:24 Thomas Gleixner
  2007-01-31 13:10 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2007-01-29 23:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Karsten Wiese, Ingo Molnar, LKML

Sigh. /me wanted to be too clever and needs to order more brown
paperbags now.

The rework of the jiffy update code introduced a one off error, which
led to a one off accounting error for last_jiffy_update. This made
jiffies lag behind.

Noticed by Karsten Wiese (cpufreq_ondemand weirdness).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Index: linux-2.6.20-rc6-mm/kernel/time/tick-sched.c
===================================================================
--- linux-2.6.20-rc6-mm.orig/kernel/time/tick-sched.c
+++ linux-2.6.20-rc6-mm/kernel/time/tick-sched.c
@@ -43,7 +43,7 @@ struct tick_sched *tick_get_tick_sched(i
  */
 static void tick_do_update_jiffies64(ktime_t now)
 {
-	unsigned long ticks = 1;
+	unsigned long ticks = 0;
 	ktime_t delta;
 
 	/* Reevalute with xtime_lock held */
@@ -60,12 +60,12 @@ static void tick_do_update_jiffies64(kti
 		if (unlikely(delta.tv64 >= tick_period.tv64)) {
 			s64 incr = ktime_to_ns(tick_period);
 
-			ticks += ktime_divns(delta, incr);
+			ticks = ktime_divns(delta, incr);
 
 			last_jiffies_update = ktime_add_ns(last_jiffies_update,
 							   incr * ticks);
 		}
-		do_timer(ticks);
+		do_timer(++ticks);
 	}
 	write_sequnlock(&xtime_lock);
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch-mm] dynticks: Fix one off jiffy update
  2007-01-29 23:24 [patch-mm] dynticks: Fix one off jiffy update Thomas Gleixner
@ 2007-01-31 13:10 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2007-01-31 13:10 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, Karsten Wiese, LKML


* Thomas Gleixner <tglx@linutronix.de> wrote:

> Sigh. /me wanted to be too clever and needs to order more brown 
> paperbags now.
> 
> The rework of the jiffy update code introduced a one off error, which 
> led to a one off accounting error for last_jiffy_update. This made 
> jiffies lag behind.
> 
> Noticed by Karsten Wiese (cpufreq_ondemand weirdness).

Karsten - thanks for tracking this regression down to the jiffies update 
code! I'm wondering, do you still the suspend slowness problem with this 
fix applied as well?

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-31 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-29 23:24 [patch-mm] dynticks: Fix one off jiffy update Thomas Gleixner
2007-01-31 13:10 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).