From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Mauerer <wolfgang.mauerer@domain.hid>
Cc: "Kiszka, Jan" <jan.kiszka@domain.hid>,
Andreas Glatz <AndreasGlatz@domain.hid>,
"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Question about getting system time
Date: Tue, 18 May 2010 17:07:00 +0200 [thread overview]
Message-ID: <4BF2AD14.6080003@domain.hid> (raw)
In-Reply-To: <4BF2AB19.5060701@domain.hid>
Wolfgang Mauerer wrote:
> [moved to xenomai-core]
>
> Gilles Chanteperdrix wrote:
>> Wolfgang Mauerer wrote:
>>>> - gettimeofday should not have another timebase than
>>>> clock_gettime(CLOCK_REALTIME): in other word, the whole clock system
>>>> should be based on the ntp clock.
>>> Sorry, I'm not quite sure what you are talking about here. The NTP
>>> corrections are provided for the clock offered in the vsyscall page
>>> by Linux, so the clock is based on the NTP clock, isn't it? Or
>>> am I misparsing your statement?
>> Unless I misunderstood your patch, what you provide is:
>> gettimeofday which uses linux timebase
>> clock_gettime which uses Xenomai timebase unrelated to linux' timebase
>> This is unacceptable. What we want is a unique timebase.
>
> okay, I see your point now. But this sound more like 3.0 stuff, doesn't
> it? The goal right now is just to have some code that generates
> synchronised, NTP corrected timestamps on Linux and Xenomai, not
> to rework the base timer handling.
We are going to open a 2.6 branch soon (we are migrating Xenomai to a
new hoster, and this job is almost finished). This will go to 2.6. And I
am not going to merge anything that would provide two different
timebases for CLOCK_REALTIME. That is too unnatural. There are a bunch
of natural things which will not work with this approach. It create many
ways to shoot oneself in the foot. So the answer is definitely no.
>> vread is a function pointer call, which:
>> - requires vsyscalls, currently only implemented on x86 (and maybe ppc)
>> - is function pointer call, so damn slow on low end hardware.
>
> ... and fast as lightning on x86 when the call is made often, which
> is the important case when speed matters. So it makes sense on this
> platform.
rdtsc is even faster. It is just one instruction.
The generic solution is even faster than the architecture specific one.
So, please implement the generic one.
>> On the one hand you make complicated code (which will be costly on low
>> end hardware) to avoid shutting interrupts around a few assignments, but
>> on the other hand you leave an architecture specific function pointer
>> call where we want a fast behaviour on average (remember, we do all this
>> to avoid a system call, which is only a few hundreds nanoseconds on your
>> big iron x86), and where we have a generic fast replacement. Sometimes,
>> I do not understand your logic.
>
> But using the same argument, you could get rid of Linux vsyscall based
> gettimeofday()...
>
> Would having the synchronised time stamp feature (maybe by another name
> than gettimeofday()) conditionally compiled on x86 be acceptable?
No. We have a generic implementation at hand for a limited amount of
additional effort. Let us do things properly.
--
Gilles.
next prev parent reply other threads:[~2010-05-18 15:07 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-13 22:14 [Xenomai-help] Question about getting system time Abhijit Majumdar
2010-05-14 5:44 ` Gilles Chanteperdrix
2010-05-14 10:34 ` Andreas Glatz
2010-05-14 10:42 ` Gilles Chanteperdrix
2010-05-17 16:27 ` Steve Deiters
2010-05-17 16:52 ` Jan Kiszka
2010-05-17 17:05 ` Steve Deiters
2010-05-17 17:13 ` Jan Kiszka
2010-05-17 18:02 ` Josh Karch
2010-05-17 18:23 ` Jan Kiszka
2010-05-17 18:51 ` Thomas Lockhart
2010-05-17 22:48 ` Steve Deiters
2010-05-17 23:50 ` Gilles Chanteperdrix
2010-05-17 23:53 ` Gilles Chanteperdrix
2010-05-18 0:23 ` Steve Deiters
2010-05-18 7:04 ` Jan Kiszka
2010-05-18 7:59 ` Gilles Chanteperdrix
2010-05-18 8:38 ` Wolfgang Mauerer
2010-05-18 10:11 ` Gilles Chanteperdrix
2010-05-18 12:11 ` Wolfgang Mauerer
2010-05-18 12:41 ` Gilles Chanteperdrix
2010-05-18 14:58 ` [Xenomai-core] " Wolfgang Mauerer
2010-05-18 15:07 ` Gilles Chanteperdrix [this message]
2010-05-18 18:41 ` Gilles Chanteperdrix
2010-05-18 20:23 ` Wolfgang Mauerer
2010-05-18 21:19 ` Gilles Chanteperdrix
2010-05-18 22:09 ` Jan Kiszka
2010-05-18 22:24 ` Gilles Chanteperdrix
2010-05-18 23:02 ` Jan Kiszka
2010-05-19 5:49 ` Gilles Chanteperdrix
2010-05-19 7:11 ` Jan Kiszka
2010-05-21 8:55 ` Gilles Chanteperdrix
2010-05-27 15:35 ` Wolfgang Mauerer
2010-05-19 19:16 ` Daniele Nicolodi
2010-05-19 20:55 ` Gilles Chanteperdrix
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=4BF2AD14.6080003@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=AndreasGlatz@domain.hid \
--cc=jan.kiszka@domain.hid \
--cc=wolfgang.mauerer@domain.hid \
--cc=xenomai@xenomai.org \
/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 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.