All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johann Obermayr <johann.obermayr@sigmatek.at>
To: Xenomai@xenomai.org
Subject: Re: [Xenomai] usage of rtdm_task_sleep_abs
Date: Fri, 10 Jul 2015 11:34:59 +0200	[thread overview]
Message-ID: <559F91C3.8090005@sigmatek.at> (raw)
In-Reply-To: <20150709155115.GK20176@hermes.click-hack.org>

Am 09.07.2015 um 17:51 schrieb Gilles Chanteperdrix:
> On Thu, Jul 09, 2015 at 05:43:03PM +0200, Johann Obermayr wrote:
>> Am 09.07.2015 um 16:19 schrieb Gilles Chanteperdrix:
>>> On Thu, Jul 09, 2015 at 02:15:55PM +0200, Johann Obermayr wrote:
>>>> Hello,
>>>>
>>>> we have follow situation
>>>>
>>>> u64 lrtdrv_time_of_irq_ns ;
>>>> void worker_task()
>>>> {
>>>> while(1)
>>>>      {
>>>>      rtdm_task_sleep_abs(lrtdrv_time_of_irq_ns + 950000ull,
>>>> RTDM_TIMERMODE_ABSOLUTE);
>>>>      do_something();
>>>>      }
>>>> }
>>>>
>>>> _kernel_rtdm_irq_handler()
>>>> {
>>>>      lrtdrv_time_of_irq_ns = rtdm_clock_read_monotonic();
>>>> }
>>>>
>>>> the  _kernel_irq_callback() is called every 1ms.
>>>> we will , that the worker_task begin 50us before next irq
>>>>
>>>> But sometime, the worker task start ~50us after irq. Why ?
>>> Best way to know, enable the I-pipe tracer, setup sufficient back
>>> trace points, and when the wrong wake up happens, trigger an I-pipe
>>> trace.
>>>
>> i will enable i-pipe tracer.
>> found out, that
>>
>> rtdm_task_sleep_abs(xxx, RTDM_TIMERMODE_ABSOLUTE);
>> u64 calc = rtdm_clock_read_monotonic();
>>
>> sometime the diff between xxx & calc is biger than 61000ns.
> This is called "kernel task scheduling latency". It can be measured by
> the latency -t 1 test.

Ok, i will test it with this test.
Here a simple list of measure from  rtdm_task_sleep_abs(xxx) calc = 
rtdm_clock_read_monotonic
Need = xxx - calc;
Need: -1189
Need: -1433
Need: -1703
Need: -2244
Need: -2330
Need: -2295
Need: -2321
Need: -2252
Need: -2313
Need: -2264
Need: -2306
Need: -2267
Need: -2280
Need: -2245
Need: 27177
Need: 26705
Need: 27497
Need: -2250
Need: -2230
Need: -481
Need: -1723
Need: -1412
Need: -716
Need: -1662
Need: -2369
Need: -2384
Need: -585
Need: -1407
Need: -769
Need: -2253
Need: 26571
Need: 87642
Need: 28411
Need: 41489
Need: -2264
Need: -1638
Need: -435
Need: -492
Need: -2424
Need: -1658
Need: -686
Need: -552
Need: -746
Need: -780
Need: -1655
Need: -1435
Need: -2234
>> forget to say.
>> worker_task run on Core1
>> irq_handler run on Core0
> Are you sure that the tsc is synchronized on both cores (you did not
> give us much information, in particular we do not know on what
> hardware you have this issue).
>
tsc must be sync, because most time it is correct.
It's a Fujitsu Mainboard with Interl 8 Series C220 with dual core
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Celeron(R) CPU G1820 @ 2.70GHz
stepping        : 3
microcode       : 0x1c
cpu MHz         : 2693.915
cache size      : 2048 KB

Regards
  Johann


  reply	other threads:[~2015-07-10  9:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 12:15 [Xenomai] usage of rtdm_task_sleep_abs Johann Obermayr
2015-07-09 14:19 ` Gilles Chanteperdrix
2015-07-09 15:43   ` Johann Obermayr
2015-07-09 15:51     ` Gilles Chanteperdrix
2015-07-10  9:34       ` Johann Obermayr [this message]
2015-07-10  9:46         ` Gilles Chanteperdrix
2015-07-10 10:43           ` Johann Obermayr
2015-07-10 10:49             ` Gilles Chanteperdrix
2015-07-13 13:41               ` Johann Obermayr
2015-07-13 14:02                 ` Gilles Chanteperdrix
2015-07-13 14:56                   ` Johann Obermayr
2015-07-13 15:24                     ` Gilles Chanteperdrix
2015-07-13 16:58                       ` Johann Obermayr
2015-07-13 17:21                         ` Gilles Chanteperdrix
2015-07-13 17:26                           ` Johann Obermayr
2015-07-13 19:58                             ` Gilles Chanteperdrix
2015-07-13 20:23                               ` Johann Obermayr
2015-07-13 20:31                                 ` Gilles Chanteperdrix
2015-07-13 20:45                                   ` Johann Obermayr
2015-07-13 20:54                                     ` Gilles Chanteperdrix
2015-07-13 21:30                                       ` Johann Obermayr
2015-07-13 21:58                                       ` Johann Obermayr
2015-07-13 22:39                                         ` Gilles Chanteperdrix
2015-07-13 23:30                                           ` Johann Obermayr
2015-07-14  0:02                                             ` Gilles Chanteperdrix
2015-07-15 21:00                                               ` Johann Obermayr
2015-07-15 21:21                                                 ` [Xenomai] ipipe trace Johann Obermayr
2015-07-16  6:30                                                 ` [Xenomai] usage of rtdm_task_sleep_abs Gilles Chanteperdrix
2015-07-16 11:46                                                   ` Johann Obermayr
2015-07-17  5:25                                                     ` Gilles Chanteperdrix
2015-07-13 20:35                                 ` 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=559F91C3.8090005@sigmatek.at \
    --to=johann.obermayr@sigmatek.at \
    --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.