All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "gprizzi@domain.hid" <gprizzi@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] error in executing xenomai tests
Date: Thu, 06 Jan 2011 21:39:11 +0100	[thread overview]
Message-ID: <4D26286F.1060309@domain.hid> (raw)
In-Reply-To: <12d5cebd852.gprizzi@domain.hid>

gprizzi@domain.hid wrote:
> Looking at the worst case of a latency of about 20 us with a task at 2 KHz
> I can estimate 2*10^-3 * 20 * 10 ^-6 = 40 * 10^-3 sec lost for latency in 1 sec..
> In the average case I will have 5*10^-3 sec. lost for latency in 1 sec. 
> 
> I think that these percentage can be accepted in a robotic position control,
> what do you think about these assumption?
> 
> Can you suggest me a better way to evaluate the latency with respect of robotic 
> position control system or can you suggest me some useful articles to read about this topic?

There is this piece of meat between your ears called a brain. Do not you
think, that, at some point, you will have to do what you are paid for
and use it?

Suppose that you have one acquisition, one one actuation, and some
real-time task between the two. If you know that the maximum allowed
time between the two is R, the worst case execution time of the
real-time task is W. Then the maximum wake up latency your system should
be able to provide is around R - W, or (R - W) / 2 if you want to play
it safe.

Of course, that was just a very sample example. And the problem you are
trying to solve may define other constraints. But that is the spirit.

In other words, I can not tell you whether 20us or 40us, or 80us is
enough for the system you are trying to build. I do not know.

Your problem is not about tuning Xenomai or preempt_rt. As far as
Xenomai is concerned, once it is installed, there are only a few things
you need to tune, and you will know when you need it. For instance, you
could start by tuning /proc/xenomai/latency so that the latency test
does not return negative values. But this is not your priority IMO.

> and I had a look at 
> 
> https://rt.wiki.kernel.org/index.php/Frequently_Asked_Questions
> 
> Do you think that setting CONFIG_PREEMT=y instead of 
> CONFIG_PREEMPT_VOLUNTARY=y
> will significantly reduce latency?

No, I was suggesting using the preempt_rt patch instead of Xenomai,
which is another way of having a deterministic operating system. With
this patch, there is no point in using CONFIG_PREEMPT or
CONFIG_PREEMPT_VOLUNTARY. The point is to use CONFIG_PREEMPT_RT.

Since you do not strike me as a co-kernel programming expert, chances
are that if preempt_rt is sufficient for the requirements of your system
and stable enough on your system, developing the application you have to
develop will be much less painful.

-- 
					    Gilles.


  reply	other threads:[~2011-01-06 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 20:01 [Xenomai-help] R: Re: R: Re: error in executing xenomai tests gprizzi
2011-01-06 20:39 ` Gilles Chanteperdrix [this message]
2011-01-06 21:25 ` [Xenomai-help] " Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2011-01-05 17:12 gprizzi
2011-01-05 17:32 ` Gilles Chanteperdrix

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=4D26286F.1060309@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=gprizzi@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.