From: Jan Kiszka <jan.kiszka@domain.hid>
To: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Synchronising TSC and periodic timer
Date: Tue, 21 Mar 2006 01:11:00 +0100 [thread overview]
Message-ID: <441F4494.5010803@domain.hid> (raw)
In-Reply-To: <200603201627.54738.lbocseg@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2466 bytes --]
Rodrigo Rosenfeld Rosas wrote:
> Em Segunda 20 Março 2006 13:51, Philippe Gerum escreveu:
>
>> ...
>> I think that you should try convincing Jan that rtdm_clock_tsc() might
>> be a good idea to provide, instead of tweaking rtdm_clock_read() in a
>> way which changes its underlying logic. ;o)
>
> Yes, that is exactly what I want! :)
> I don't see any reason for changing rtdm_timer_read() neither. I think that
> the most common usage of high-precision timestamps is for relative time
> cases. It doesn't need to be in sync with Xenomai's timer... It is best to
> keep things simple.
>
> What do you think Jan?
We discussed a lot about how to prevent the user shooting him/herself in
the knee with inter-tick timestamps, but I still think that
rtdm_clock_read_tsc() would even be worse in this regard.
xnarch_get_cpu_tsc() and derived skin services are not supposed to
deliver consistent results across multiple CPUs, are they? While the
user could avoid such scenarios by locking tasks on a specific CPU,
drivers cannot - at least so far. So, to safely introduce such a
low-level service for RTDM, I think we need
A) CPU affinity for RTDM-registered IRQs
B) CPU affinity for RTDM kernel tasks
C) Some well written docs, explaining how to safely use TSCs at driver
level and how to provide them to the user (the latter aspect makes me
worry most)
While A) and B) might be useful for other (though rare) scenarios as
well, C) will still require a very good understanding and interface
design from the driver writer, while I don't see comparable error
dimensions with the improved rtdm_clock_read(). Comparing apples
(rtdm_clock_read()) to oranges (rt_timer_read()), there will be some
error around a tick period. But comparing apple[0]
(rtdm_clock_read_tsc() on CPU#0) to apple[1] (rtdm_clock_read_tsc() on
CPU#1), the error could become *much* larger and the design and
documentation effort to avoid this will be significant.
Ok, as a simple resolution for this problem, I could imagine introducing
a TSC timestamping service to RTDM that always fall back to that level
of accuracy which is guaranteed to be consistent - either because we run
in aperiodic mode, or on uniprocessor, or thanks to some magic
synchronisation between all CPU clocks. This would have to be decided at
build time, in the first version likely by checking for (multiprocessor
|| aperiodic) to switch to xnpod_get_time().
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2006-03-21 0:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 20:45 [Xenomai-core] Synchronising TSC and periodic timer Jan Kiszka
2006-03-15 7:24 ` Jan Kiszka
[not found] ` <4417C74D.3060203@domain.hid>
2006-03-15 8:14 ` Jan Kiszka
2006-03-15 12:59 ` Philippe Gerum
2006-03-15 13:26 ` Gilles Chanteperdrix
2006-03-15 22:58 ` Philippe Gerum
2006-03-20 11:48 ` Jan Kiszka
2006-03-20 13:26 ` Philippe Gerum
2006-03-20 14:42 ` Rodrigo Rosenfeld Rosas
2006-03-20 16:51 ` Philippe Gerum
2006-03-20 19:27 ` Rodrigo Rosenfeld Rosas
2006-03-21 0:11 ` Jan Kiszka [this message]
2006-03-21 3:11 ` Rodrigo Rosenfeld Rosas
2006-03-20 14:46 ` Jan Kiszka
2006-03-21 12:44 ` Philippe Gerum
2006-03-24 13:14 ` Jan Kiszka
[not found] ` <200603201137.12548.rosenfeld@domain.hid>
2006-03-20 15:23 ` Philippe Gerum
2006-03-20 19:01 ` Rodrigo Rosenfeld Rosas
2006-03-21 17:57 ` Philippe Gerum
2006-03-15 13:34 ` Gilles Chanteperdrix
2006-03-15 16:50 ` Jan Kiszka
2006-03-16 15:26 ` Gilles Chanteperdrix
2006-03-17 1:16 ` Jan Kiszka
[not found] <1CFEB358338412458B21FAA0D78FE86D02CABF1C@rennsmail02.eu.thmulti.com>
2006-03-15 17:20 ` Jan Kiszka
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=441F4494.5010803@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=lbocseg@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.