mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Bohac <jbohac@suse.cz>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, vojtech@suse.cz
Subject: [PATCH for 2.6.19] Fix xtime losing ticks
Date: Thu, 16 Nov 2006 17:52:01 +0100	[thread overview]
Message-ID: <20061116165201.GA18128@dwarf.suse.cz> (raw)

xtime is not properly incremented when main timer ticks are lost.
Whatever the number of ticks elapsed is, only one tick worth of time
is added to xtime. This patch fixes that.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>

Index: linux-2.6.19-rc5/kernel/timer.c
===================================================================
--- linux-2.6.19-rc5.orig/kernel/timer.c
+++ linux-2.6.19-rc5/kernel/timer.c
@@ -904,7 +904,7 @@ static void clocksource_adjust(struct cl
  *
  * Called from the timer interrupt, must hold a write on xtime_lock.
  */
-static void update_wall_time(void)
+static void update_wall_time(unsigned long ticks)
 {
 	cycle_t offset;
 
@@ -915,7 +915,7 @@ static void update_wall_time(void)
 #ifdef CONFIG_GENERIC_TIME
 	offset = (clocksource_read(clock) - clock->cycle_last) & clock->mask;
 #else
-	offset = clock->cycle_interval;
+	offset = ticks * clock->cycle_interval;
 #endif
 	clock->xtime_nsec += (s64)xtime.tv_nsec << clock->shift;
 
@@ -1053,7 +1053,7 @@ void run_local_timers(void)
  */
 static inline void update_times(unsigned long ticks)
 {
-	update_wall_time();
+	update_wall_time(ticks);
 	calc_load(ticks);
 }
   
-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CR


             reply	other threads:[~2006-11-16 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 16:52 Jiri Bohac [this message]
2006-11-16 16:58 ` Andi Kleen

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=20061116165201.GA18128@dwarf.suse.cz \
    --to=jbohac@suse.cz \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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