From: john stultz <johnstul@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [RFC] linux-2.4.21-pre1_lost-tick_A0
Date: 16 Dec 2002 14:09:29 -0800 [thread overview]
Message-ID: <1040076569.1576.21.camel@w-jstultz2.beaverton.ibm.com> (raw)
In-Reply-To: <1040076206.1583.14.camel@w-jstultz2.beaverton.ibm.com>
All,
On the x440, we occasionally (or not so occasionally) get SMIs that
take longer then a few ticks. This can cause brief inconsistencies in
gettimeofday values, as well as clock drift. This patch is my first
patch at compensating for the lost ticks. This applies on top of the
cyclone-timer_B3 patch.
Comments, feedback, and flames requested.
thanks
-john
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c Mon Dec 16 13:57:55 2002
+++ b/arch/i386/kernel/time.c Mon Dec 16 13:57:55 2002
@@ -279,6 +279,7 @@
static inline void mark_timeoffset_cyclone(void)
{
int count;
+ unsigned long delta = last_cyclone_timer;
spin_lock(&i8253_lock);
/* quickly read the cyclone timer */
if(cyclone_timer)
@@ -291,6 +292,13 @@
count |= inb(0x40) << 8;
spin_unlock(&i8253_lock);
+ /*lost tick compensation*/
+ delta = last_cyclone_timer - delta;
+ if(delta > loops_per_jiffy+2000){
+ delta = (delta/loops_per_jiffy)-1;
+ jiffies += delta;
+ }
+
count = ((LATCH-1) - count) * TICK_SIZE;
delay_at_last_interrupt = (count + LATCH/2) / LATCH;
}
next prev parent reply other threads:[~2002-12-16 22:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-16 22:03 [PATCH] linux-2.4.21-pre1_cyclone-timer_B3 john stultz
2002-12-16 22:09 ` john stultz [this message]
2002-12-16 23:15 ` Alan Cox
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=1040076569.1576.21.camel@w-jstultz2.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®