Skip to contentSkip to conversation

high res timestamps and SMP

DISCUSSION Chris Friesen 4 participants 5 messages Nov 19, 2003 – Nov 20, 2003

lore
Share & tools
lore
#0 lore raw

We have a requirement to have high-res timestamps available on SMP systems.

Assuming that we are running identical cpus, is a sync-up at boot time enough to give usable time values, or do I need to do force periodic re-syncs?

We're currently looking at MIPS, x86 (Xeons), and PPC.

Thanks,

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]
#1 lore raw
Quoted 5 lines · Chris Friesen

We have a requirement to have high-res timestamps available on SMP systems.

Assuming that we are running identical cpus, is a sync-up at boot time enough to give usable time values, or do I need to do force periodic re-syncs?

If the cpus (or their time stamp counter) are all driven by the same signal and you do not suffer from NUMA effects, then syncing them should be enough.

However, if you suffer from NUMA effects, or if the counters are not driven off the same signal, its likely you could run into problems.

Quoted 1 line

We're currently looking at MIPS, x86 (Xeons), and PPC.

o No clue on MIPS.

o The x86 TSC is a horrible time source, but may work well enough on simple SMP systems.

o PPC has a nice in-cpu time-base register (ppc folks, feel free to smack or correct me on this) which is driven off the bus-clock and is synced in hardware.

good luck!
-john

#2 lore raw
Quoted 2 lines · john stultz
Quoted 1 line · Chris Friesen

We have a requirement to have high-res timestamps available on SMP systems.

...

Quoted 3 lines

o PPC has a nice in-cpu time-base register (ppc folks, feel free to smack or correct me on this) which is driven off the bus-clock and is synced in hardware.

Last time I checked, all 32-bit PowerPC chips ran that clock at 1/4 of the bus clock speed.

That may be adequate for time-of-day and I/O delays and such, but it's worthless for timestamps or performance measurements.

It's possible to count core clocks via a performance counter, but I don't know if they are synced between CPUs.

#3 lore raw

Hi,

Quoted 2 lines

Last time I checked, all 32-bit PowerPC chips ran that clock at 1/4 of the bus clock speed.

It depends on the chip, on recent ppc64 boxes its 1/8 of the processor clock speed.

Quoted 2 lines

That may be adequate for time-of-day and I/O delays and such, but it's worthless for timestamps or performance measurements.

Can you show me the application that depends on timestamps being that accurate?

Running the multiplier at a set fraction of the processor speed is a good idea I think. Go look at any large x86 box (and possibly ia64 box) and you will find the timebases are not synced. Even our biggest box has the timebase synced, its easy to do when the timebase is running at a reasonable rate.

In a trade off between unsynced timebases and timebase running at a fraction of the cpu speed, ill take the latter :) (Ask the x86 guys what a pain unsynced timebases are)

Anton

#4 lore raw
Quoted 3 lines · Anton Blanchard

Running the multiplier at a set fraction of the processor speed is a good idea I think. Go look at any large x86 box (and possibly ia64 box) and you will find the timebases are not synced.

By "large", you mean NUMA, right? I was under the impression that the kernel did sync up the timebases for SMP.

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]