[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1170113083.29240.74.camel@localhost.localdomain>
Date: Tue, 30 Jan 2007 00:24:43 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Andrew Morton <akpm@...l.org>
Cc: Karsten Wiese <fzu@...gehoertderstaat.de>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>
Subject: [patch-mm] dynticks: Fix one off jiffy update
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@...utronix.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);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists