From: Loic Prylli <Loic.Prylli@ens-lyon.fr>
Subject: Re: Self-build PC164SX-kernel: clock twice too fase
Date: Wed, 25 Feb 1998 19:44:01 +0100 (MET) [thread overview]
Message-ID: <1767bb4e53e7173810f6d87c41c86ce0.axp-list@archive.invalid> (raw)
In-Reply-To: <199802241042.LAA02008@stefan.sime.com>
Hello,
I may have solve the problem of clock running twice too fast:
The time reported by our PWS500a (aka MIATA) was also running much too
fast (more than two hours per day). It seems that the interrupt
handler is called at least twice for some ticks (the hardware
interrupt state has probably not been reset properly after the first
interrupt).
Here is the experiment I have done to understand the problem:
At first I just try to adjust the microsecond per tick variable (with
tickadj from xntp package). I needed a microseond per tick value of
~835 instead of 977 as would imply (HZ= 1024).
Suprisingly, under high HD activity the clock was accelerating by
more than 10% (enough to prevent any possible synchronisationby
NTP). Ethernet activity would make it go slower by about 10% also.
I insert some code to measure the interval in processor cycles between
two calls to the timer_interrupt routine. An histogram told that about
one time out of six, the interval between calls to the timer_interrupt
routine was of the order of one microsecond, the rest of the time is
was a normal interval of about 1ms.
So I just inserted a test at the beginning of the timer_interrupt, if
there has not been a significant number of clock cycles since last
call, the routine returns immediatly. Here an extract of the patch:
--- linux/arch/alpha/kernel/time.c~ Wed Feb 18 11:50:56 1998
+++ linux/arch/alpha/kernel/time.c Wed Feb 18 11:53:05 1998
@@ -68,6 +68,8 @@
now = rpcc();
delta = now - state.last_time;
state.last_time = now;
+ if (delta < state.cycles_per_tick / 16)
+ return;
if (delta > state.max_cycles_per_tick) {
int i, missed_ticks;
Also on our PWS hwrpb->cycle_freq is set to 0 (this can be seen in
/proc/cpuinfo) , I wonder if the line below in time_init() instruction
dangerous? (well is seems to work as is x/0 = 0 until now)? Does
anybody now how to obtain the cycle_freq on this architecture?
state.scaled_ticks_per_cycle = ((unsigned long) HZ << FIX_SHIFT) / hwrpb->cycle_freq;
Lastly, I have made a patch to give gettimeofday microsecond
resolution, if anybody is interested to test it, I will send it.
Regards,
Loic
PS: this the third time since a week I try to send this message, maybe
messages originating from an e-mail adress not subscribed to the list
are silently dropped? Hope this time you will get it.
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next parent reply other threads:[~1998-02-25 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199802241042.LAA02008@stefan.sime.com>
1998-02-25 18:44 ` Loic Prylli [this message]
1998-02-24 10:42 Self-build PC164SX-kernel: clock twice too fase Stefan Traby
-- strict thread matches above, loose matches on Subject: below --
1998-02-23 21:26 Wim van Dorst
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox