* RE: Alpha Timekeeping - Hardware Questions
@ 1999-05-13 18:03 James Livingston
0 siblings, 0 replies; 13+ messages in thread
From: James Livingston @ 1999-05-13 18:03 UTC (permalink / raw)
To: 'axp-list@redhat.com'
Most Alpha platforms, including SMP systems, have both CPU cycle
counters and free-running clocks, including TOY clocks and the
8254-compatible timers found in most (E)ISA bridges. Which clock is
used for what purpose is the choice of the kernel implementers, I
expect.
Cheers,
jwl
James W. Livingston, Jr. - Alpha NT Servers Group
COMPAQ Computer Corporation, DEQwest Engineering
14475 NE 24th Street, Bellevue, Washington 98007-3740
Email: jwl@zso.dec.com * Tel: (425) 865-8792
Fax: (425) 865-8890 * DTN: 548-8792
-----Original Message-----
From: Bruce Elliott [mailto:bde@nwlink.com]
Sent: Thursday, May 13, 1999 3:07 AM
To: linux-kernel@vger.rutgers.edu
Cc: recipient list not shown
Subject: Alpha Timekeeping - Hardware Questions
On May 12, 2:01pm, Tom Holroyd wrote:
} Subject: 2.2.8 gettimeofday() still doesn't work on Alpha
} Just booted 2.2.8 on my PC164 and the timetest program (included
below)
} produces negative deltas with high frequency.
[ ... ]
I believe that I have read that (some) SMP Alphas have independent CPU
clocks (i.e. the oscillators that drive the "cycle counters"). Is this
true? If so, any cycle-counter-based timekeeping will be difficult, as
it requires drift-correction (something like ntp) at timer interrupt
level.
If only some Alphas have separate CPU clocks, are these older models?
For recent and current Alphas, is it true that the various clocks (PIT,
RT, CYCLES) are separate, or are they (or a subset) derived (pll?) from
a common source?
I am sending this to several lists and individuals. I would appreciate
that any definitive answers or references either be sent to the linux-
kernel list, or to me for forwarding to the list.
--
B. D. Elliott bde@nwlink.com (Seattle)
--
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
@ 1999-05-17 6:28 Bruce Elliott
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Elliott @ 1999-05-17 6:28 UTC (permalink / raw)
To: linux-kernel, linux-alpha, axp-list
Cc: davem, rth, Jay.Estabrook, tomh, jwl, colin
I received a reply from Colin Plumb <colin@alumni.cs.colorado.edu>, that
included the following:
> ... *many* alpha SMP systems have independent oscillators for each
> CPU. Dave "Mr. NTP" Mills has some example Digital Unix kernel patches
> that synchronize each CPU independently.
>
> ...
>
> They may have changed on recent Alphas, but in the old ones, each
> processor has its own ... clock oscillator. ...
Since Mr. Plumb has been active in the NTP community, I accept his word
on this.
If anyone knows for certain that recent systems do synchronize the CPU
clocks, it would be useful to note that in these mailing lists, so that
future development might take advantage of it.
Since I don't have access to an MP Alpha, I can't contribute further in
this area. I would like to thank everyone who has taken time to try to
resolve this.
--
B. D. Elliott bde@nwlink.com (Seattle)
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Alpha Timekeeping - Hardware Questions
@ 1999-05-15 1:14 James Livingston
1999-05-15 2:45 ` Jay.Estabrook
0 siblings, 1 reply; 13+ messages in thread
From: James Livingston @ 1999-05-15 1:14 UTC (permalink / raw)
To: 'axp-list@redhat.com'
Bruce,
See my comment below. There have been a number of different SMP
implementations, starting with the AlphaServer 2100 4/200, but I don't
believe there have been any that didn't use a common system clock
signal.
Cheers,
jwl
-----Original Message-----
From: Bruce Elliott [mailto:bde@nwlink.com]
Sent: Friday, May 14, 1999 2:49 AM
To: linux-kernel@vger.rutgers.edu
Cc: recipient list not shown
Subject: Re: Alpha Timekeeping - Hardware Questions
On May 14, 12:15am, Jay.Estabrook@digital.com wrote:
>
> >>> "David S. Miller" said:
> > Date: Thu, 13 May 1999 09:16:56 -0700
> > From: Richard Henderson <rth@cygnus.com>
> >
> > I have no definitive answer, but I would strongly suspect we
cannot
> > rely on tick mechanisms with SMP.
> >
> > Unless Alpha's support different clock rate cpus mixed into a single
> > machine, you can use something like Ingo's tick calibration code at
> > boot time to make sure all cpu's have synchronized tick values.
>
> I don't believe that any of our boxes support CPUs at different clocks
> at the same time... ;-}
>
> But that's a good idea, WRT those patches, as I have been seeing one
> effect of routing all interrupts to CPU #0: its tick-count (IRQ #8)
> lags behind the counts in the other CPUs... :-\
[ ... ]
[ ... ]
The only way frequency differences can be avoided is to use a common
clock source across CPUs. This could either be the actual clock used as
input to the CPU, or it could be a slower clock that is phase-locked to
the CPU input clock.
So the question remains: Do SMP Alpha CPUs have synchronized input
clocks?
[jwl] Yes, they do. The general pattern is to propagate a
single system clock frequency onto the CPU modules, where it's
recreated via PLL to drive the Alpha CPU on the module. I hope this
is specific enough for your purposes.
[ ... ]
--
B. D. Elliott bde@nwlink.com (Seattle)
--
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-15 1:14 James Livingston
@ 1999-05-15 2:45 ` Jay.Estabrook
0 siblings, 0 replies; 13+ messages in thread
From: Jay.Estabrook @ 1999-05-15 2:45 UTC (permalink / raw)
To: axp-list
>>> James Livingston said:
>
> There have been a number of different SMP
> implementations, starting with the AlphaServer 2100 4/200, but I don't
> believe there have been any that didn't use a common system clock signal.
Yes, this is so, a common clock *to* the CPUs.
And also, each CPU uses a PLL to generate its internal clock from the common
one.
However, because of the nature of PLLs (so I'm told), there can be no
guarantee that the CPUs will operate in lock-step, nor that they will
have cycle-counters that operate at the same frequency. *CLOSE*, but
no guarantee of exactness.
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Motherboards - LINUX Project
Compaq Computer Corporation (508) 841-3241 or (DTN) 237-3241
334 South Street, Shrewsbury, MA 01545 Jay.Estabrook@digital.com
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
@ 1999-05-14 9:48 Bruce Elliott
1999-05-14 10:56 ` Matti Aarnio
1999-05-14 18:41 ` Richard Henderson
0 siblings, 2 replies; 13+ messages in thread
From: Bruce Elliott @ 1999-05-14 9:48 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-alpha, axp-list, Jay.Estabrook, davem, rth, tomh
On May 14, 12:15am, Jay.Estabrook@digital.com wrote:
>
> >>> "David S. Miller" said:
> > Date: Thu, 13 May 1999 09:16:56 -0700
> > From: Richard Henderson <rth@cygnus.com>
> >
> > I have no definitive answer, but I would strongly suspect we cannot
> > rely on tick mechanisms with SMP.
> >
> > Unless Alpha's support different clock rate cpus mixed into a single
> > machine, you can use something like Ingo's tick calibration code at
> > boot time to make sure all cpu's have synchronized tick values.
>
> I don't believe that any of our boxes support CPUs at different clocks
> at the same time... ;-}
>
> But that's a good idea, WRT those patches, as I have been seeing one
> effect of routing all interrupts to CPU #0: its tick-count (IRQ #8)
> lags behind the counts in the other CPUs... :-\
[ ... ]
I'm sorry to keep harping on this, but I still don't know the answer to
the original main question.
In late November I submitted a patch to arch/alpha/kernel/time.c to fix
some obvious problems and to try to stabilize timekeeping. A non-obvious
consequence of this patch was that timekeeping was now based on the
cycle counter, instead of the RTC or PIT. The RTC/PIT was still used as
a "wakeup", but not as the actual basis for kernel jiffies.
This patch was added to the kernel, but I missed it when scanning the
patch files, so I assumed it had been rejected. In the meantime I found
some cases I had overlooked (mostly in settimeofday()) and updated my
local patches to fix these.
At the end of December I rechecked and discovered that the original patch
had been accepted, so I submitted the second fix with a note that perhaps
it should wait until 2.3, as I thought 2.3 was imminent.
The second patch was rejected, leaving timekeeping still broken, although
perhaps not quite as badly as it had been.
Around the beginning of March I had correspondence with another Alpha user
who was quite dissatisfied with the timekeeping. The main symptom was
that time-of-day sometimes jumped backward. After much email I found
most of the remaining problems. I submitted another patch but included
the suggestion/request that the original patch be backed-out, as by then
I had read the claim that SMP Alpha CPUs have unsynchronized clocks.
This patch was also rejected or perhaps missed, as I sent it only to the
list in hope of clarification from someone.
Around the end of April someone else (Thorsten Kranzkowski) submitted a
patch fixing part of the lost-tick accounting, which was in patch three.
Someone else referred Thorsten to my earlier message, and he resubmitted
that patch with some changes.
The point of this long harangue is that Alpha kernels currently use the
cycle counter for timekeeping. If SMP Alpha clocks are unsynchronized,
this is a Bad Thing. Please note that "unsynchronized" refers to the
frequencies, and not phase differences. To restate this, as there may be
some confusion, a frequency difference implies that the offsets between
different CPU cycle counters *change* over time. For example, a frequency
difference of one part-per-million would cause a drift of one jiffy in
about fifteen minutes.
The only way frequency differences can be avoided is to use a common
clock source across CPUs. This could either be the actual clock used as
input to the CPU, or it could be a slower clock that is phase-locked to
the CPU input clock.
So the question remains: Do SMP Alpha CPUs have synchronized input clocks?
If they are not sychronized, this code must be replaced with something
else.
If they are synchronized, SMP timekeeping can be fixed by either resetting
the cycle counters via PalCode at boot time, or by measuring the offsets
at boot time.
Assuming synchronized clocks, the pros and cons for using the cycle counter
appear (to me) to be:
Con:
The underlying clock may be less stable than the RTC or PIT. Assuming
synchronized CPU clocks, I would expect the PIT to be derived from the
same source.
Pro:
The cycle counter provides two orders-of-magnitude better resolution than
the PIT. The PIT counter can be accessed, giving about one microsecond
resolution.
The cycle counter provides five orders-of-magnitude better resolution than
the RTC. The RTC offers no resolution beyond the fact that an interrupt
occurred.
--
B. D. Elliott bde@nwlink.com (Seattle)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-14 9:48 Bruce Elliott
@ 1999-05-14 10:56 ` Matti Aarnio
1999-05-14 12:48 ` Uncle George
1999-05-16 19:23 ` Chris Wedgwood
1999-05-14 18:41 ` Richard Henderson
1 sibling, 2 replies; 13+ messages in thread
From: Matti Aarnio @ 1999-05-14 10:56 UTC (permalink / raw)
To: axp-list
Cc: linux-kernel, linux-alpha, axp-list, Jay.Estabrook, davem, rth,
tomh
....
> The only way frequency differences can be avoided is to use a common
> clock source across CPUs. This could either be the actual clock used as
> input to the CPU, or it could be a slower clock that is phase-locked to
> the CPU input clock.
>
> So the question remains: Do SMP Alpha CPUs have synchronized input clocks?
At older Laser and TurboLaser multiprocessor systems
all CPUs seem to be running at same clock, or one which
is in PLL lock to some system wide distributed reference.
See DEC Technical Journal stories about 4100 system.
http://www.digital.com/DTJO00/
I have never heard of actual instances of multiprocessor systems
where processors run at different clock speeds, even if that were
technically possible by decoupling CPU internal operations, and
external system bus.
...
> B. D. Elliott bde@nwlink.com (Seattle)
/Matti Aarnio
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-14 10:56 ` Matti Aarnio
@ 1999-05-14 12:48 ` Uncle George
1999-05-16 19:23 ` Chris Wedgwood
1 sibling, 0 replies; 13+ messages in thread
From: Uncle George @ 1999-05-14 12:48 UTC (permalink / raw)
To: axp-list
I dont think u mean at different clock rates, but at a (slightly) different
time when the timer hits the interval. Ie resolution of 1ns, cpu clock gets
ticked at 1.1 ns, cpu #2 get ticked at 1.3ns, cpu #3 at 1.5ns. This is to
prevent everyone from grabbing the Semmaphores/mutex's at the same time, where
only one will get the lock, and the other ( quite figurally ) spin whout doing
any usefull work. This was the strategy used on the SMP PDP-10's
gat
Matti Aarnio wrote:
> ....
> > The only way frequency differences can be avoided is to use a common
> > clock source across CPUs. This could either be the actual clock used as
> > input to the CPU, or it could be a slower clock that is phase-locked to
> > the CPU input clock.
> >
> > So the question remains: Do SMP Alpha CPUs have synchronized input clocks?
>
> At older Laser and TurboLaser multiprocessor systems
> all CPUs seem to be running at same clock, or one which
> is in PLL lock to some system wide distributed reference.
>
> See DEC Technical Journal stories about 4100 system.
>
> http://www.digital.com/DTJO00/
>
> I have never heard of actual instances of multiprocessor systems
> where processors run at different clock speeds, even if that were
> technically possible by decoupling CPU internal operations, and
> external system bus.
>
> ...
> > B. D. Elliott bde@nwlink.com (Seattle)
>
> /Matti Aarnio
>
> --
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-14 10:56 ` Matti Aarnio
1999-05-14 12:48 ` Uncle George
@ 1999-05-16 19:23 ` Chris Wedgwood
1999-05-16 20:05 ` Jeff DeMaagd
1 sibling, 1 reply; 13+ messages in thread
From: Chris Wedgwood @ 1999-05-16 19:23 UTC (permalink / raw)
To: Matti Aarnio
Cc: axp-list, linux-kernel, linux-alpha, Jay.Estabrook, davem, rth,
tomh
> At older Laser and TurboLaser multiprocessor systems
> all CPUs seem to be running at same clock, or one which
> is in PLL lock to some system wide distributed reference.
Could, in theory, a PLL skip? Thus resulting in smal differences
after long periods of uptime?
-cw
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-16 19:23 ` Chris Wedgwood
@ 1999-05-16 20:05 ` Jeff DeMaagd
0 siblings, 0 replies; 13+ messages in thread
From: Jeff DeMaagd @ 1999-05-16 20:05 UTC (permalink / raw)
To: axp-list
On Mon, 17 May 1999, Chris Wedgwood wrote:
> > At older Laser and TurboLaser multiprocessor systems
> > all CPUs seem to be running at same clock, or one which
> > is in PLL lock to some system wide distributed reference.
>
> Could, in theory, a PLL skip? Thus resulting in smal differences
> after long periods of uptime?
It should be rare, but maybe possible. I didn't ask this question in my
EE clases. But, at least with all the PLLs using the same base clock
should re-synch on every input beat, so even if one was drifting, it'll
get corrected on the next pulse. But then, failures are possible, but
then if it skips, you may be having bigger problems down the road than
'just' clock skew.
Jeff DeMaagd
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Alpha Timekeeping - Hardware Questions
1999-05-14 9:48 Bruce Elliott
1999-05-14 10:56 ` Matti Aarnio
@ 1999-05-14 18:41 ` Richard Henderson
1 sibling, 0 replies; 13+ messages in thread
From: Richard Henderson @ 1999-05-14 18:41 UTC (permalink / raw)
To: axp-list, linux-kernel; +Cc: linux-alpha, Jay.Estabrook, davem, rth, tomh
On Fri, May 14, 1999 at 02:48:50AM -0700, Bruce Elliott wrote:
> The point of this long harangue is that Alpha kernels currently use the
> cycle counter for timekeeping. If SMP Alpha clocks are unsynchronized,
> this is a Bad Thing.
In the 2.2.8 patch I just posted, I included the settimeofday fix
forwarded from Thorsten, and for SMP am not including the rpcc bits
in the [sg]ettimeofday results.
I think I'm back to, for SMP, using the rpcc only for lost interrupt
estimation. Please look over what's there and send me any corrections
as necessary.
r~
^ permalink raw reply [flat|nested] 13+ messages in thread
* Alpha Timekeeping - Hardware Questions
@ 1999-05-13 10:07 Bruce Elliott
1999-05-13 22:23 ` Richard Henderson
[not found] ` <19990513091656.A28220@cygnus.com>
0 siblings, 2 replies; 13+ messages in thread
From: Bruce Elliott @ 1999-05-13 10:07 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-alpha, axp-list, tomh, rth, Jay.Estabrook
On May 12, 2:01pm, Tom Holroyd wrote:
} Subject: 2.2.8 gettimeofday() still doesn't work on Alpha
} Just booted 2.2.8 on my PC164 and the timetest program (included below)
} produces negative deltas with high frequency.
[ ... ]
I believe that I have read that (some) SMP Alphas have independent CPU
clocks (i.e. the oscillators that drive the "cycle counters"). Is this
true? If so, any cycle-counter-based timekeeping will be difficult, as
it requires drift-correction (something like ntp) at timer interrupt
level.
If only some Alphas have separate CPU clocks, are these older models?
For recent and current Alphas, is it true that the various clocks (PIT,
RT, CYCLES) are separate, or are they (or a subset) derived (pll?) from
a common source?
I am sending this to several lists and individuals. I would appreciate
that any definitive answers or references either be sent to the linux-
kernel list, or to me for forwarding to the list.
--
B. D. Elliott bde@nwlink.com (Seattle)
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Alpha Timekeeping - Hardware Questions
1999-05-13 10:07 Bruce Elliott
@ 1999-05-13 22:23 ` Richard Henderson
[not found] ` <19990513091656.A28220@cygnus.com>
1 sibling, 0 replies; 13+ messages in thread
From: Richard Henderson @ 1999-05-13 22:23 UTC (permalink / raw)
To: Bruce Elliott, linux-kernel
Cc: linux-alpha, axp-list, tomh, rth, Jay.Estabrook
On Thu, May 13, 1999 at 03:07:16AM -0700, Bruce Elliott wrote:
> } Subject: 2.2.8 gettimeofday() still doesn't work on Alpha
> } Just booted 2.2.8 on my PC164 and the timetest program (included below)
> } produces negative deltas with high frequency.
>
> [ ... ]
>
> I believe that I have read that (some) SMP Alphas have independent CPU
> clocks (i.e. the oscillators that drive the "cycle counters"). Is this
> true? If so, any cycle-counter-based timekeeping will be difficult, as
> it requires drift-correction (something like ntp) at timer interrupt
> level.
Thats rather irrelevant to a UP PC164.
r~
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <19990513091656.A28220@cygnus.com>]
* Re: Alpha Timekeeping - Hardware Questions
[not found] ` <19990513091656.A28220@cygnus.com>
@ 1999-05-14 9:50 ` David S. Miller
0 siblings, 0 replies; 13+ messages in thread
From: David S. Miller @ 1999-05-14 9:50 UTC (permalink / raw)
To: rth; +Cc: bde, linux-kernel, linux-alpha, axp-list, tomh, Jay.Estabrook
Date: Thu, 13 May 1999 09:16:56 -0700
From: Richard Henderson <rth@cygnus.com>
I have no definitive answer, but I would strongly suspect we cannot
rely on tick mechanisms with SMP.
Unless Alpha's support different clock rate cpus mixed into a single
machine, you can use something like Ingo's tick calibration code at
boot time to make sure all cpu's have synchronized tick values.
Later,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~1999-05-17 7:12 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-05-13 18:03 Alpha Timekeeping - Hardware Questions James Livingston
-- strict thread matches above, loose matches on Subject: below --
1999-05-17 6:28 Bruce Elliott
1999-05-15 1:14 James Livingston
1999-05-15 2:45 ` Jay.Estabrook
1999-05-14 9:48 Bruce Elliott
1999-05-14 10:56 ` Matti Aarnio
1999-05-14 12:48 ` Uncle George
1999-05-16 19:23 ` Chris Wedgwood
1999-05-16 20:05 ` Jeff DeMaagd
1999-05-14 18:41 ` Richard Henderson
1999-05-13 10:07 Bruce Elliott
1999-05-13 22:23 ` Richard Henderson
[not found] ` <19990513091656.A28220@cygnus.com>
1999-05-14 9:50 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox