Skip to contentSkip to conversation

TSCs synchron on multi-core CPUs?

Xenomai-help M. Koehrer 3 participants 3 messages Jun 3, 2008

lore
Share & tools
lore

M. Koehrer

author
#0 lore raw

Hi everybody,

I have a question concerning the time stamp counters of the Intel core2duo/quad CPUs. They will be used e.g. with the Xenomai native skin call rt_time_tsc which ends up in an assembler statement "rdtsc".
My question is now:
Are the values of TSC synchron with dual/quad core CPUs? Or is there a possible drift between the CPUs?
Background of the question is:
I want to measure the time of a event that occurs within one task.
A second event is checked in another task on a different core. The time difference between the events has to be checked.
Can this be done precisely with rdtsc() or is a mechanism required that uses the TSC of exactly one core?

Thanks for all hints on that question!

Regards

Mathias

Signature · 5 lines
Mathias Koehrer
[email protected]


Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 60 Pay TV Sender, einen elektronischen Programmführer mit Movie Star Bewertungen von TV Movie. Außerdem, aktuelle Filmhits und spannende Dokus in der Arcor-Videothek. Infos unter www.arcor.de/tv
#1 lore raw
Quoted 20 lines

Hi everybody,

I have a question concerning the time stamp counters of the Intel core2duo/quad CPUs.
They will be used e.g. with the Xenomai native skin call rt_time_tsc which ends up in
an assembler statement "rdtsc".
My question is now:
Are the values of TSC synchron with dual/quad core CPUs? Or is there a possible drift between
the CPUs?
Background of the question is:
I want to measure the time of a event that occurs within one task. A second event is checked in another task on a different core. The time difference between the
events has to be checked.
Can this be done precisely with rdtsc() or is a mechanism required that uses the TSC of exactly one
core?

Quoted 5 lines

Thanks for all hints on that question!

Regards

Mathias

Hi Mathias,

TSC of the cores may differ: http://en.wikipedia.org/wiki/Time_Stamp_Counter

Best regards
Karl

Signature · 1 line
von Karl Reichert
#2 lore raw
Quoted 22 lines · Karl Reichert
Quoted 22 lines

Hi everybody,

I have a question concerning the time stamp counters of the Intel core2duo/quad CPUs.
They will be used e.g. with the Xenomai native skin call rt_time_tsc which ends up in
an assembler statement "rdtsc".
My question is now:
Are the values of TSC synchron with dual/quad core CPUs? Or is there a possible drift between
the CPUs?
Background of the question is:
I want to measure the time of a event that occurs within one task. A second event is checked in another task on a different core. The time difference between the
events has to be checked.
Can this be done precisely with rdtsc() or is a mechanism required that uses the TSC of exactly one
core?

Thanks for all hints on that question!

Quoted 7 lines
Quoted 3 lines

Regards

Mathias

Hi Mathias,

TSC of the cores may differ: http://en.wikipedia.org/wiki/Time_Stamp_Counter

And if they do on your box, clocktest from the testsuite can tell you.

Note that Xenomai currently relies on TSC being synchronized, or that you switch to a TSC-less CPU type in your kernel config. Once this becomes and actual problem for a use case, one may consider adding HPET as clocksource for Xenomai. So far this wasn't the case.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux