All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lowell Gilbert <kludge@be-well.ilk.org>
To: xenomai@xenomai.org
Subject: Re: [Xenomai] rtdm_timer_start latency?
Date: Mon, 12 Feb 2018 08:41:04 -0500	[thread overview]
Message-ID: <44o9kumikv.fsf@lowell-desk.lan> (raw)
In-Reply-To: <44d11e1akp.fsf@be-well.ilk.org> (Lowell Gilbert's message of "Fri, 09 Feb 2018 09:50:30 -0500")

Lowell Gilbert <kludge@be-well.ilk.org> writes:

> Philippe Gerum <rpm@xenomai.org> writes:
>
>> On 02/09/2018 11:02 AM, Philippe Gerum wrote:
>>> On 02/09/2018 12:45 AM, Lowell Gilbert wrote:
>>>> Am I correct in assuming that when calling rtdm_timer_start(), I should
>>>> not be getting multi-second latencies before the first call to the timer
>>>> routine? Just checking before I dig in too far.
>>>>
>>> 
>>> Of course not. I suspect an absolute expiry time is given with a
>>> relative mode spec.
>>> 
>>
>> More generally, an absolute expiry time which is not based on the right
>> clock specified by the mode argument.
>>
>> i.e.
>>
>> expiry = rtdm_clock_monotonic(), mode = RTDM_TIMERMODE_REALTIME => BAD
>> expiry = rtdm_clock_realtime(), mode = RTDM_TIMERMODE_ABSOLUTE => BAD
>> expiry = rtdm_clock_realtime() or _monotonic(), mode =
>> RTDM_TIMERMODE_RELATIVE => BAD
>
> Okay, that makes sense.
>
> I was using 0 for expiry, because I really just wanted the periodic
> wakeup. I don't remember why I didn't create a periodic task instead of
> using a timer.
>
> What clock do I want to use to get the timer started? Once it starts, it
> runs fine; but it often takes two or three seconds before the first call
> into the handler.
>
> To put it another way, I'm trying to figure out what am I doing wrong in:
> 		ret = rtdm_timer_start(&pstate.collect.timer, 1,
> 				       pstate.collect.period,
> 				       RTDM_TIMERMODE_RELATIVE);

I could just rewrite the code to use a periodic task, but I'd prefer to
understand what is actually wrong with my current code first, to be sure
that refactoring will really solve my problem.

Or I could have the timer run constantly, but that is just hacking
around the problem, not really solving it.

Thanks for all help, past and future.


  parent reply	other threads:[~2018-02-12 13:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 23:45 [Xenomai] rtdm_timer_start latency? Lowell Gilbert
2018-02-09 10:02 ` Philippe Gerum
2018-02-09 10:11   ` Philippe Gerum
2018-02-09 14:50     ` Lowell Gilbert
2018-02-09 15:00       ` Lowell Gilbert
2018-02-12 13:41       ` Lowell Gilbert [this message]
2018-02-12 14:25         ` Lange Norbert
2018-02-12 16:32           ` Lowell Gilbert
2018-02-13 17:04         ` Lowell Gilbert
2018-02-13 19:36           ` Auel, Kendall

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=44o9kumikv.fsf@lowell-desk.lan \
    --to=kludge@be-well.ilk.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.