* [Xenomai-help] accuracy of system clock
@ 2007-11-19 9:29 Theo Veenker
2007-11-19 15:25 ` Gilles Chanteperdrix
0 siblings, 1 reply; 5+ messages in thread
From: Theo Veenker @ 2007-11-19 9:29 UTC (permalink / raw)
To: Xenomai
Hi all,
I'm using clock_gettime(REALTIME,&t) in a kernel module (posix skin) to
timestamp something. I know accessing this clock from user space yields
values different from those returned by the xenomai posix skin due to
ntpdate. But my concern is that the difference in pace is too much.
On one system it is about 90us/s wrong on another it is 160us/s.
I assume the speed of the ntp corrected clock is more or less correct.
Is there some calibration procedure I can run to tweak xenomai to make
sure in xenomai I get 1e9 ticks per *true* second?
I have enabled CONFIG_X86_UP_APIC.
Theo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] accuracy of system clock
2007-11-19 9:29 [Xenomai-help] accuracy of system clock Theo Veenker
@ 2007-11-19 15:25 ` Gilles Chanteperdrix
2007-11-19 15:46 ` Theo Veenker
2007-11-19 15:47 ` Jan Kiszka
0 siblings, 2 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2007-11-19 15:25 UTC (permalink / raw)
To: Theo Veenker; +Cc: Xenomai
On Nov 19, 2007 10:29 AM, Theo Veenker <Theo.Veenker@domain.hid> wrote:
> Hi all,
>
> I'm using clock_gettime(REALTIME,&t) in a kernel module (posix skin) to
> timestamp something. I know accessing this clock from user space yields
> values different from those returned by the xenomai posix skin due to
> ntpdate.
Well, you can use the posix skin in user-space as well.
> But my concern is that the difference in pace is too much.
> On one system it is about 90us/s wrong on another it is 160us/s.
>
> I assume the speed of the ntp corrected clock is more or less correct.
> Is there some calibration procedure I can run to tweak xenomai to make
> sure in xenomai I get 1e9 ticks per *true* second?
> I have enabled CONFIG_X86_UP_APIC.
There is currently no way to calibrate Xenomai, but there is a known
issue about the APIC frequency specifically. I do not know if some
quick fixes have been posted, but there is a (rather large) series of
patches fixing it.
--
Gilles Chanteperdrix
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-help] accuracy of system clock
2007-11-19 15:25 ` Gilles Chanteperdrix
@ 2007-11-19 15:46 ` Theo Veenker
2007-11-19 20:54 ` Gilles Chanteperdrix
2007-11-19 15:47 ` Jan Kiszka
1 sibling, 1 reply; 5+ messages in thread
From: Theo Veenker @ 2007-11-19 15:46 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai
Gilles Chanteperdrix wrote:
> On Nov 19, 2007 10:29 AM, Theo Veenker <Theo.Veenker@domain.hid> wrote:
>> Hi all,
>>
>> I'm using clock_gettime(REALTIME,&t) in a kernel module (posix skin) to
>> timestamp something. I know accessing this clock from user space yields
>> values different from those returned by the xenomai posix skin due to
>> ntpdate.
>
> Well, you can use the posix skin in user-space as well.
>
>> But my concern is that the difference in pace is too much.
>> On one system it is about 90us/s wrong on another it is 160us/s.
>
>> I assume the speed of the ntp corrected clock is more or less correct.
>> Is there some calibration procedure I can run to tweak xenomai to make
>> sure in xenomai I get 1e9 ticks per *true* second?
>> I have enabled CONFIG_X86_UP_APIC.
>
> There is currently no way to calibrate Xenomai, but there is a known
> issue about the APIC frequency specifically. I do not know if some
> quick fixes have been posted, but there is a (rather large) series of
> patches fixing it.
Can you suggest a different timing source? I thought using the APIC
was preferred over using the TSC. What do other users do if they want
1 ms to last 1 ms?
If the drift appears to be constant on each system I can problably account
for it and apply a correction. I'll try that.
Theo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] accuracy of system clock
2007-11-19 15:46 ` Theo Veenker
@ 2007-11-19 20:54 ` Gilles Chanteperdrix
0 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2007-11-19 20:54 UTC (permalink / raw)
To: Theo Veenker; +Cc: Xenomai
Theo Veenker wrote:
> Gilles Chanteperdrix wrote:
> > On Nov 19, 2007 10:29 AM, Theo Veenker <Theo.Veenker@domain.hid> wrote:
> >> Hi all,
> >>
> >> I'm using clock_gettime(REALTIME,&t) in a kernel module (posix skin) to
> >> timestamp something. I know accessing this clock from user space yields
> >> values different from those returned by the xenomai posix skin due to
> >> ntpdate.
> >
> > Well, you can use the posix skin in user-space as well.
> >
> >> But my concern is that the difference in pace is too much.
> >> On one system it is about 90us/s wrong on another it is 160us/s.
> >
> >> I assume the speed of the ntp corrected clock is more or less correct.
> >> Is there some calibration procedure I can run to tweak xenomai to make
> >> sure in xenomai I get 1e9 ticks per *true* second?
> >> I have enabled CONFIG_X86_UP_APIC.
> >
> > There is currently no way to calibrate Xenomai, but there is a known
> > issue about the APIC frequency specifically. I do not know if some
> > quick fixes have been posted, but there is a (rather large) series of
> > patches fixing it.
>
> Can you suggest a different timing source? I thought using the APIC
> was preferred over using the TSC. What do other users do if they want
> 1 ms to last 1 ms?
The timing source used by Xenomai is the tsc, not the apic.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] accuracy of system clock
2007-11-19 15:25 ` Gilles Chanteperdrix
2007-11-19 15:46 ` Theo Veenker
@ 2007-11-19 15:47 ` Jan Kiszka
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2007-11-19 15:47 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai
Gilles Chanteperdrix wrote:
> On Nov 19, 2007 10:29 AM, Theo Veenker <Theo.Veenker@domain.hid> wrote:
>> Hi all,
>>
>> I'm using clock_gettime(REALTIME,&t) in a kernel module (posix skin) to
>> timestamp something. I know accessing this clock from user space yields
>> values different from those returned by the xenomai posix skin due to
>> ntpdate.
>
> Well, you can use the posix skin in user-space as well.
BTW, there is a dedicated clocktest in the testsuite to estimate drifts
of Xenomai's clocks from the Linux gettimeofday.
>
>> But my concern is that the difference in pace is too much.
>> On one system it is about 90us/s wrong on another it is 160us/s.
>
>> I assume the speed of the ntp corrected clock is more or less correct.
>> Is there some calibration procedure I can run to tweak xenomai to make
>> sure in xenomai I get 1e9 ticks per *true* second?
>> I have enabled CONFIG_X86_UP_APIC.
>
> There is currently no way to calibrate Xenomai, but there is a known
True. In fact, a generic clock adjustment interface using arbitrary
external sources is on the agenda for the next major Xenomai version
(2.5?) - which will unfortunately take a while to be rolled out. But
inputs/contributions to this effort are always welcome and can
accelerate the development at least of this particular feature.
> issue about the APIC frequency specifically. I do not know if some
> quick fixes have been posted, but there is a (rather large) series of
> patches fixing it.
The APIC issue only impacts the timer, not the clock. And so far I've
seen only too early timer events, basically causing overhead due to
multiple early timer IRQs.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-19 20:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 9:29 [Xenomai-help] accuracy of system clock Theo Veenker
2007-11-19 15:25 ` Gilles Chanteperdrix
2007-11-19 15:46 ` Theo Veenker
2007-11-19 20:54 ` Gilles Chanteperdrix
2007-11-19 15:47 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.