mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Karsten Wiese <fzu@wemgehoertderstaat.de>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: [patch-mm] dynticks: Fix one off jiffy update
Date: Tue, 30 Jan 2007 00:24:43 +0100	[thread overview]
Message-ID: <1170113083.29240.74.camel@localhost.localdomain> (raw)

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);
 }



             reply	other threads:[~2007-01-29 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 23:24 Thomas Gleixner [this message]
2007-01-31 13:10 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170113083.29240.74.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@osdl.org \
    --cc=fzu@wemgehoertderstaat.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome