All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Paul <paul@crubille.lautre.net>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Linux port to ARM Allwinner A13
Date: Tue, 12 Mar 2013 06:06:48 +0100	[thread overview]
Message-ID: <513EB7E8.7080303@xenomai.org> (raw)
In-Reply-To: <513EB578.9040904@xenomai.org>

On 03/12/2013 05:56 AM, Gilles Chanteperdrix wrote:

> On 03/11/2013 11:47 PM, Paul wrote:
> 
>> Some precision and 2 small examples about a preempt test:
>>
>> On 11/03/2013 08:47, Gilles Chanteperdrix wrote:
>>> On 03/11/2013 10:15 AM, Paul wrote:
>>>
>>>> Hello,
>>>>
>>>> ... ... ...
>>>>
>>>> I check the priority masking with a preempt test which is derived
>>>> from the latency test: The real time task loop for 1/4 of its period
>>>> reading and rereading the clock, so i get the min, avg and worst case
>>>> that the task can be preempted while it is running.
>>>
>>>> If you are interested in this test, i can post it when I have
>>>> modified the output messages.
>>>
>>>
>>> I do not really understand. Why would it be more preempted in the first
>>> 1/4 of its period?
>>>
>>>
>> No reason sure but -
>>   It can be preempted only while it is running, so between the time it 
>> is restarted after sleeping and before it go to sleep again.
>> Let it running 1/4 of the period is enough to catch lots of events if 
>> there is lots of irqs but not too much so linux, dohell or even xenomai 
>> tasks can run just a bit slower.
>>
>>
>> Here are some result i get (yes with the priority interrupt masking, and 
>> i am pretty sure it work - but the watchdog is on).
>> There is a dohell at the same time in the whole experiment and i start 
>> X11, stop it , restart it  ...
>>
>>
>> root@debian:/usr/xenomai/bin# 
>> /usr/src/build_xenomai/src/testsuite/preempt/preempt -p 111
>> == Sampling period: 111 us
>> == Test mode: periodic user-mode task
>> == All results in microseconds
>> warming up...
>> RTT|  00:00:01  (periodic user-mode task, 111 us period, priority 99)
>> RTH|----pre min|----pre avg|----pre max|-overrun|---msw|---pre 
>> best|--pre worst
>> RTD|      0.333|      0.374|      3.333|       0|     0|      
>> 0.333|      3.333
>> RTD|      0.333|      0.374|     15.666|       0|     0|      0.333|     
>> 15.666
>> ---|-----------|-----------|-----------|--------|------|-------------------------
>>
>> RTH|----pre min|----pre avg|----pre max|-overrun|---msw|---pre 
>> best|--pre worst
>> RTD|      0.333|      0.374|      3.708|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.874|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.541|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.916|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.541|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.583|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.499|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.833|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.791|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.666|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.833|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.749|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.749|       0|     0|      0.333|     
>> 23.333
>> RTD|      0.333|      0.374|      3.624|       0|     0|      0.333|     
>> 23.333
>> ^C---|-----------|-----------|-----------|--------|------|-------------------------
>> RTS|      0.333|      0.374|     23.333|       0|     0|    
>> 00:13:33/00:13:33
>>
>>
>> A second experiment, just setting the period to 100 (and the period for 
>> the watchdog is a multiple so 3/4 it never preempt the task:
> 
> 
> Looks only like pure luck to me. As you may or may not know, Xenomai
> uses the timer in one-shot mode, so, the watchdog tick has no reason to
> be aligned with your application timer. I would say the chances for your
> task to be preempted by the watchdog tick while it is measuring is 1/4...
> 
> 

Of course the difference if your application timer is a sub-multiple of
the watchdog timer is that the watchdog will always preempt your
application at the same moment, so, if it did not preempt it during the
first quarter of one period during the first second, it will never do.

-- 
                                                                Gilles.


  reply	other threads:[~2013-03-12  5:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26  0:11 [Xenomai] Linux port to ARM Allwinner A13 Paul
2013-02-25 22:28 ` Gilles Chanteperdrix
2013-03-11  9:15   ` Paul
2013-03-11  7:47     ` Gilles Chanteperdrix
2013-03-11  8:15       ` Gilles Chanteperdrix
2013-03-11 22:29       ` Paul
2013-04-09 22:05         ` Gilles Chanteperdrix
2013-03-11 22:47       ` Paul
2013-03-12  4:56         ` Gilles Chanteperdrix
2013-03-12  5:06           ` Gilles Chanteperdrix [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-06 12:56 kunming yang

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=513EB7E8.7080303@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=paul@crubille.lautre.net \
    --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.