All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] RTDM and Timer functions
Date: Tue, 14 Mar 2006 11:27:02 -0300	[thread overview]
Message-ID: <200603141127.02738.lbocseg@domain.hid> (raw)
In-Reply-To: <4416666B.5040201@domain.hid>

Em Ter=E7a 14 Mar=E7o 2006 03:44, Jan Kiszka escreveu:

>Rodrigo Rosenfeld Rosas wrote:
>> Em Segunda 13 Mar=E7o 2006 20:05, Jan Kiszka escreveu:
>>> ...
>>>
>>>>> We would definitely need a good name for it,
>>>>> rtdm_clock_read_ex(<clock-id>), rtdm_clock_read_tsc(),
>>>>> rtdm_clock_read_monotonic()? I'm not going to break rtdm_clock_read()
>>>>> by adding an argument (otherwise, I would have to fix too many drivers
>>>>> on my own... :-/).
>>>>
>>>> That is the idea, I think. I agree that rtdm_clock_read() should be ke=
pt
>>>> as it is (the API/definition). No body is asking you to change it.
>>>> Adding rtdm_clock_read_tsc() would be sufficient in my opinion whilst =
it
>>>> maintain coherency with other skins.
>>>
>>> Thinking about this more thoroughly, a few questions popped up for me:
>>>
>>> o When we call it rtdm_clock_read_tsc(), we should actually return the
>>>  raw TSC values, shouln't we? But then we also need conversion
>>>  functions (rtdm_clock_tsc2ns, rtdm_clock_ns2tsc). Or should we always
>>>  convert to nanoseconds on return? POSIX and Native are different in
>>>  this regard.
>>
>> I would prefer returning always ns, but both solutions would fit my need=
s,
>> so I'm not really worried about this topic.
>>
>>> o What would be the core rationale behind it, having a high-resolution
>>>  time stamp? What are the primary use cases? I'm asking for this so
>>>  that I can clearly differentiate between this new service and the
>>>  existing one in the docs. Also, giving an abstract description would
>>>  leave more options to the actual implementation on other archs or
>>>  platforms.
>>
>> As I've said, I think that it is good to give some independency to the
>> driver, at least to the time related functions, for not depending on the
>> user chosen timer behaviour for some delay routines. Eg, I would like to
>> wait a specified amount of us before testing some register. That is a
>> quite normal task when
>
>This is what rtdm_task_busy_sleep() already provides - independent of
>the system timer.

I didn't know it was independent from the timer. Good to know. I think it=20
would worth enforce this statement on its documentation.

>> developing drivers. Another one is for timeouts on short delays. In those
>> cases, we want a good resolution, but this should be independent of the
>> user's timer choice IMO.
>
>And this is something rtdm_clock_read_tsc() will obviously not be for.

Please, take a look in my case. The specification recommends wait at least =
Xus=20
before testing a bit. But the time to wait is not constant, it can vary a f=
ew=20
microseconds. So, I busy wait Xus and then do some code like:

rtdm_task_busy_sleep(X*1000);
start_time =3D rtdm_clock_read[_tsc]();
do {
condition=3Dtestbit();
} while (! condition && (time_passed(start_time) < TIMEOUT));

But if the user specifies a periodic timer, with tickval=3D1ms, then my dri=
ver=20
will be too slow. I could busy wait TIMEOUT before testing, and it would be=
=20
faster then the above code in this case. But I would like to go away as soo=
n=20
as possible, ie, just after the bit has been set...

>
>Again, when the user / system administrator decided to lower the timer
>resolution in favour of performance, it is not possible (and doesn't
>make sense) to circumvent this decision at driver level (except for busy
>waiting).

But my situation is still a busy wait but written in another form.

>So, I wonder what you plan to do with the return value of the=20
>new function?

I think I've already explained myself.

Best regards,

Rodrigo.

		
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
http://br.acesso.yahoo.com



  reply	other threads:[~2006-03-14 14:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09 17:43 [Xenomai-core] RTDM and Timer functions Rodrigo Rosenfeld Rosas
2006-03-09 20:33 ` Jan Kiszka
2006-03-10 13:54   ` Rodrigo Rosenfeld Rosas
2006-03-10 18:32     ` Jan Kiszka
2006-03-10 20:00       ` Rodrigo Rosenfeld Rosas
2006-03-13 11:48         ` Jan Kiszka
2006-03-13 14:54           ` Rodrigo Rosenfeld Rosas
2006-03-13 17:15             ` Rodrigo Rosenfeld Rosas
2006-03-13 17:58               ` Rodrigo Rosenfeld Rosas
2006-03-13 18:24                 ` Jan Kiszka
2006-03-13 19:25                   ` Rodrigo Rosenfeld Rosas
2006-03-13 19:19                 ` Rodrigo Rosenfeld Rosas
2006-03-15  4:44                   ` Jim Cromie
2006-03-13 18:12             ` Jan Kiszka
2006-03-14  1:28               ` Rodrigo Rosenfeld Rosas
2006-03-13 17:25       ` Gilles Chanteperdrix
2006-03-13 17:31         ` Rodrigo Rosenfeld Rosas
2006-03-13 18:33           ` Jan Kiszka
2006-03-13 19:31             ` Rodrigo Rosenfeld Rosas
2006-03-13 23:05               ` Jan Kiszka
2006-03-14  1:36                 ` Rodrigo Rosenfeld Rosas
2006-03-14  6:44                   ` Jan Kiszka
2006-03-14 14:27                     ` Rodrigo Rosenfeld Rosas [this message]
2006-03-14 16:46                       ` Jan Kiszka
2006-03-14 16:59                         ` Rodrigo Rosenfeld Rosas
2006-03-14 18:45                           ` Rodrigo Rosenfeld Rosas
2006-03-14 19:00                             ` Jan Kiszka
2006-03-14 19:40                               ` Rodrigo Rosenfeld Rosas
2006-03-14 20:29                                 ` Jan Kiszka
2006-03-14 22:32                                   ` Rodrigo Rosenfeld Rosas
2006-03-14 22:51                                     ` Jan Kiszka
2006-03-15  0:31                                       ` Rodrigo Rosenfeld Rosas
2006-03-15 13:06                                     ` Philippe Gerum
     [not found]                 ` <44167BE9.2090703@domain.hid>
2006-03-14 10:16                   ` 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=200603141127.02738.lbocseg@domain.hid \
    --to=lbocseg@domain.hid \
    --cc=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.