All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Synchronising TSC and periodic timer
Date: Fri, 24 Mar 2006 14:14:25 +0100	[thread overview]
Message-ID: <4423F0B1.5010402@domain.hid> (raw)
In-Reply-To: <441FF539.5050704@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2647 bytes --]

Philippe Gerum wrote:
> Jan Kiszka wrote:
>> ...
>> On the other hand, the advantage of TSC-based synchronised inter-tick
>> timestamps is that you can do things like
>>
>>     sleep_until(rt_timer_ns2ticks(rtdm_clock_read() + 1000000))
>>
>> without risking an error beyond +/- 1 tick (+jitter). With current
>> jiffies vs. TSC in periodic mode, this is not easily possible. You have
>> to sync in the application, creating another error source when the delay
>> between acquiring the TSC and sync'ing the TSC on jiffies is too long.
>>
> 
> The proper way to solve this is rather to emulate the periodic mode over
> the oneshot machinery, so that we stop having this +/- 1 tick error
> margin. The periodic mode as it is now is purely a x86 legacy; even on
> some ppc boards where the auto-reload feature is available from the
> decrementer, Xeno doesn't use it.
> 
> The more I think of the x86 situation, the more I find it quite silly. I
> mean, picking the periodic mode means that 1) all delays can be
> expressed as multiples of a given constant interval, 2) the constant
> interval must be large enough so that you don't put your board on its
> knees, by processing useless ticks most of the time. What one saves here
> - using periodic mode - is a couple of outb's per tick on the ISA bus,
> since the PIT handles this automatically without software intervention
> once set up properly. We already know that the programming overhead
> (i.e. introduced by those outb's) is perfectly bearable even for high
> frequency sampling like 10Khz loops in aperiodic mode. So why on earth
> do we care about saving two outb's and get a lousy timing accuracy in
> the same move, for constant interval delays which are necessarily going
> to be much larger than those already supported by the aperiodic mode? Er...
> 
> This is a shift in the underlying logic of the periodic mode we are
> discussing here actually. It used to be a mode where timing accuracy was
> only approximate, mostly to deal with timeouts, in the watchdog sense.
> Now, it is becoming a way to rely on a constant interval unit, while
> still keeping a high timing accuracy. I'm ok with this, since we don't
> rely on true PIT (except for x86, which is fixable) when running in
> periodic mode, so I see no problem in raising the level of timing
> accuracy of such mode. Existing stuff would not break because of such
> change, but improve instead for people who care for exact durations in
> periodic mode.

Yep, getting rid of as much periodic mode limitations as reasonable in a
transparent way sounds very good to me.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2006-03-24 13:14 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
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 [this message]
     [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=4423F0B1.5010402@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --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.