9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Presotto <presotto@closedmind.org>
To: rsc@plan9.bell-labs.com, rog@vitanuova.com, 9fans@cse.psu.edu
Subject: Re: [9fans] odd clock behaviour
Date: Thu, 13 Mar 2003 13:43:00 -0500	[thread overview]
Message-ID: <2c0e3fcc0cf73b379494bd3a978f43c4@plan9.bell-labs.com> (raw)

> i'm running on an IBM Thinkpad (T22), and occasionally (not always) i
> get the clock running much faster than it should (#r/rtc still gives
> the correct time)
>
> as an example (i ran this a few minutes ago):
> % echo `{cat '#r/rtc'; cat /dev/time; }; sleep 100; echo `{cat '#r/rtc'; cat /dev/time; }
> 1047563747 1047629025 1047629025597639124 41354973397504 305454592
> 1047563792 1047629508 1047629508199623282 41502386389760 305454592
> % % echo `{cat '#r/rtc'; cat /dev/time; }; sleep 100; echo `{cat '#r/rtc'; cat /dev/time; }
> 1047563991 1047632392 1047632392826308124 42383508857344 305454592
> 1047564039 1047632728 1047632728118785531 42485925484288 305454592
> % % % echo `{cat '#r/rtc'; cat /dev/time; }; sleep 100; echo `{cat '#r/rtc'; cat /dev/time; }
> 1047564093 1047633210 1047633210610709377 42633304858112 305454592
> 1047564136 1047633742 1047633742398391924 42795741847808 305454592
> %
>
> i.e.  /dev/time advanced by 483, 336 and 532 seconds respectively,
> while #r/rtc advanced by 45, 48 and 43 seconds respectively,
> all for a nominally 100 second sleep!
>

The 305454592 is 256 times the i8253 clock frequency.  I just clock 0
as the HZ clock interrupt and clock 2 as the TOD clock.  It's frequency
is 1193182, but I really multiply it and ticks by 256 to give timesync
a number with more precision to tweak, i.e., it gives me a more precise
multiplier.

You're clearly not running timesync since the frequency (the last
number) hasn't been tweaked at all.

However, your your i8253's are ticking at an incredibly variable rate.
It looks to me like something else is using clock 2.  It supposed to be
there for us to screw with as we will but apparently not.  Do you have
some music player running that might be using it as a clock source?


             reply	other threads:[~2003-03-13 18:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13 18:43 David Presotto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-20 18:07 rog
2003-03-13 18:58 rog
2003-03-13 19:15 ` David Presotto
2003-03-13 19:25   ` Russ Cox
2003-03-13 18:06 rog
2003-03-13 14:43 rog
2003-03-13 14:25 rog
2003-03-13 14:30 ` Fco.J.Ballesteros
2003-03-13 15:40 ` Russ Cox
2003-03-13 16:22 ` Sam
2003-03-13 16:26   ` David Presotto
2003-03-13 17:06     ` Russ Cox
2003-03-13 17:50       ` Fco.J.Ballesteros
2003-03-13 18:39 ` Dan Cross
2003-03-13 18:40 ` Dan Cross

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=2c0e3fcc0cf73b379494bd3a978f43c4@plan9.bell-labs.com \
    --to=presotto@closedmind.org \
    --cc=9fans@cse.psu.edu \
    --cc=rog@vitanuova.com \
    --cc=rsc@plan9.bell-labs.com \
    /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;
as well as URLs for NNTP newsgroup(s).