All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Huge clock drift
Date: Sun, 29 May 2011 17:38:05 +0200	[thread overview]
Message-ID: <4DE2685D.5010807@domain.hid> (raw)
In-Reply-To: <4DE1724A.2040400@domain.hid>

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

On 2011-05-29 00:08, Gilles Chanteperdrix wrote:
> On 05/28/2011 04:32 PM, Jan Kiszka wrote:
>> On 2011-05-27 21:11, Gilles Chanteperdrix wrote:
>>> On 05/27/2011 08:29 PM, Jonas Witt wrote:
>>>> Sorry, I missed the NTP-part. I am not using NTP. Just plain timer 
>>>> queries on a single system.
>>>>
>>>> My clock source is tsc which is the same for Xenomai I suppose.
>>>>
>>>> I wonder how a Xenomai task, even if it occupies 50% or even 90% of a 4 
>>>> milliseconds time slice can interfere with the tsc. The tsc is not 
>>>> incremented via an interrupt, is it? But I do not know much about the 
>>>> inner workings of these functions.
>>>
>>> The problem is not the clocksource, the problem is the timer interrupt.
>>> The kernel expects 1 timer tick every millisecond.
>>
>> Not on archs that are CONFIG_NO_HZ capable.
> 
> Last time I looked at CONFIG_NO_HZ, it did not look as Xenomai one-shot
> timer at all. The system still had a periodic timer ticking HZ times by
> second, in order to handle the non-high resolution timers. And this
> timing was entirely disabled only when the system was idle. So, in other
> word, the Linux kernel still needed a periodic timer interrupt.

Linux (with some architectural exceptions) no longer needs high-rate
timer ticks for time keeping. Of course, if you miss timer events due to
high Xenomai activity (or overload of the host machine when running as a
VM), that's not good for reactivity and may have other side effects.

> 
>>
>>> When you run a
>>> real-time task during 2 milliseconds and prevent the kernel from
>>> receiving the timer interrupts, you certainly disrupt its timekeeping.
>>> If you want to do this, switch the Linux kernel frequency (CONFIG_HZ) to
>>> 100.
>>
>> Time keeping can perfectly bridge a lot of missing ticks as far as the
>> underlying clocksource allows. And that's quite a bit with the x86 TSC.
> 
> Here, we are asking it to only receive one interrupt over two. I have to
> admit that I talked without testing, but as long as we do not test the
> kernel behaviour in order to test whether it allows such disruption, I
> find it safer to advise people not to disrupt it.

I'm not suggesting people can now safely write RT hogs. But I don't
think the overload scenario here should be responsible for the clock drift.

Jan


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

  reply	other threads:[~2011-05-29 15:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 17:28 [Xenomai-help] Huge clock drift Jonas Witt
2011-05-27  6:40 ` Gilles Chanteperdrix
2011-05-27 14:19   ` Jonas Witt
2011-05-27 14:38     ` Gilles Chanteperdrix
2011-05-27 15:05       ` Jan Kiszka
2011-05-27 16:22         ` Gilles Chanteperdrix
2011-05-27 18:29         ` Jonas Witt
2011-05-27 19:11           ` Gilles Chanteperdrix
2011-05-28 14:32             ` Jan Kiszka
2011-05-28 22:08               ` Gilles Chanteperdrix
2011-05-29 15:38                 ` Jan Kiszka [this message]
2011-05-30  7:03               ` Pavel Machek
2011-05-30  7:07                 ` Jan Kiszka
2011-05-30  7:43                   ` Jonas Witt
2011-05-30  7:57                     ` Jan Kiszka
2011-05-30 10:31                       ` Jonas Witt
2011-05-30 10:33                         ` Pavel Machek
2011-05-30 12:32                           ` Jonas Witt
2011-05-30 13:08                             ` 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=4DE2685D.5010807@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@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.