From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] ns vs. tsc as internal timer base
Date: Tue, 13 Jun 2006 12:51:15 +0200 [thread overview]
Message-ID: <448E98A3.6080707@domain.hid> (raw)
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
Hi,
between some football half-times of the last days ;), I played a bit
with a hand-optimised xnarch_tsc_to_ns() for x86. Using scaled math, I
achieved between 3 (P-I 133 MHz) to 4 times (P-M 1.3 GHz) faster
conversions than with the current variant. While this optimisation only
saves a few ten nanoseconds on high-end, slow processors can gain
several hundreds of nanos per conversion (my P-133: -600 ns).
This does not come for free: accuracy of very large values is slightly
worse, but that's likely negligible compared to the clock accuracy of
TSCs (does anyone have any real numbers on the latter, BTW?).
As we loose some bits the one way, converting back still requires "real"
division (i.e. the use of the existing slower xnarch_ns_to_tsc).
Otherwise, we would get significant errors already for small intervals.
To avoid loosing the optimisation again in ns_to_tsc, I thought about
basing the whole internal timer arithmetics on nanoseconds instead of
TSCs as it is now. Although I dug quite a lot in the current timer
subsystem the last weeks, I may still oversee aspects and I'm
x86-biased. Therefore my question before thinking or even patching
further this way: What was the motivation to choose TSCs as internal
time base? Any pitfalls down the road (except introducing regressions)?
Jan
PS: All this would be 2.3-stuff, for sure.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next reply other threads:[~2006-06-13 10:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-13 10:51 Jan Kiszka [this message]
2006-06-13 11:16 ` [Xenomai-core] ns vs. tsc as internal timer base Philippe Gerum
2006-06-13 11:56 ` Jan Kiszka
2006-06-13 12:31 ` Philippe Gerum
2006-06-13 13:07 ` Gilles Chanteperdrix
2006-06-13 13:28 ` Philippe Gerum
2006-06-13 13:34 ` Gilles Chanteperdrix
2006-06-13 13:45 ` Philippe Gerum
2006-06-13 13:33 ` Jan Kiszka
2006-06-13 13:51 ` Philippe Gerum
2006-06-13 16:19 ` Jan Kiszka
2006-06-13 16:29 ` Gilles Chanteperdrix
2006-06-13 17:04 ` Philippe Gerum
2006-06-13 17:13 ` Gilles Chanteperdrix
2006-06-13 17:58 ` Philippe Gerum
2006-06-14 9:25 ` Jim Cromie
2006-06-14 12:29 ` Philippe Gerum
2006-06-14 13:07 ` Jan Kiszka
2006-06-14 16:04 ` Jan Kiszka
2006-07-25 18:26 ` [Xenomai-core] Timer optimisations, continued Jan Kiszka
2006-07-27 8:53 ` Philippe Gerum
2006-07-27 12:42 ` Gilles Chanteperdrix
2006-07-27 13:19 ` Philippe Gerum
2006-07-27 13:54 ` Jan Kiszka
2006-07-27 14:10 ` Philippe Gerum
2006-06-13 11:59 ` [Xenomai-core] ns vs. tsc as internal timer base Gilles Chanteperdrix
2006-06-13 12:00 ` Anders Blomdell
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=448E98A3.6080707@domain.hid \
--to=jan.kiszka@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.