All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: rolandtollenaar@domain.hid
Cc: Xenomai-help@domain.hid
Subject: Re: [Xenomai-help] Re: Latencies due to RT-Socket-CAN register accesses
Date: Thu, 29 Mar 2007 20:59:09 +0200	[thread overview]
Message-ID: <460C0C7D.7000001@domain.hid> (raw)
In-Reply-To: <460BECFD.2030003@domain.hid>

Roland Tollenaar wrote:
> Hi Wolfgang,
> 
> Typically without load the average latecny is 30 us and 20 us min 
> latency. Yes I am using the latency program of the test suit.
> 
> Where do I check to find the latency "killer" settings? The 
> powermanagement and all that s switched of. As is the PC speaker. What 
> else can I look at?

Here is what I get on a much slower PC (Athlon 1.1 GHz):
[root@domain.hid bin]# ./latency -p500
    RTT|  00:00:01  (periodic user-mode task, 500 us period, priority 99)
    RTH|-----lat min|-----lat avg|-----lat max|-overrun|
    ---|------------|------------|------------|--------|
    RTS|       1.309|       1.988|      10.723|       0|

Could you show us your .config file as Stephane ask for and the output 
of /proc/cpuinfo. Unfortunately, I have little experience with PC 
hardware and it's bad impact on the latency.

Wolfgang.


> Wolfgang Grandegger wrote:
>> Roland Tollenaar wrote:
>>> Hi Wolfgang,
>>>
>>> I think that this kind of latency should be fine for controller 
>>> intervals of 1ms.
>>>
>>> Another question:
>>> The PC has a 3Ghz processor and an 800Mhz FSB. That should not class 
>>> as "slow" in the conventional sense. What hardware is responsible for 
>>> the latency i.e. makes the PC "slow" from the RT perspective? In 
>>> other words what must one look at when purchasing a machine that 
>>> should give minimal latency?
>>
>> I ment "slow" in the sense of little CPU power, but that's obviously 
>> not the case. How have you measured these figures? With the "latency" 
>> program from the test suite? What is the min latency _without_ load? 
>> And also check Xenomai's TROUBLESHOOTING file. Already changing the 
>> kernel configuration to avoid latency "killers" might help.
>>
>> Wolfgang.
>>
>>> Regards,
>>>
>>> Roland.
>>>
>>>
>>> Wolfgang Grandegger wrote:
>>>> roland Tollenaar wrote:
>>>>> Hi Wolfgang,
>>>>>
>>>>> Just to answer an open question still
>>>>>
>>>>>> > BTW, what are the latencies you measure on your system under load
>>>>>> > (without RT-Socket-CAN).
>>>>>
>>>>> lat min 20.952
>>>>> lat ave 31.009
>>>>> lat max 60.504
>>>>> lat best 19.276
>>>>>
>>>>> this was with the loading as you described in this thread and running
>>>>> for 12 hours.
>>>>>
>>>>> Anything special about the above figures? Not very good I presume but
>>>>> I am not running with tsc enabled.
>>>>
>>>> The latencies depend a lot on the hardware. The minimal latency of 
>>>> 20 us indicates, that you have a rather slow system. Then a maximum 
>>>> of 60 us is reasonable. Note that worst case latencies of better 
>>>> than 20us are difficult to achieve, even with high end PCs.
>>>>
>>>> Wolfgang.
>>>>
>>>>> Kind regards,
>>>>>
>>>>> Roland
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Roland
>>>>>>
>>>>>>
>>>>>> >
>>>>>> > Wolfgang.
>>>>>> >
>>>>>> >> Thanks,
>>>>>> >>
>>>>>> >> Roland
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> Wolfgang Grandegger wrote:
>>>>>> >>> Hallo,
>>>>>> >>>
>>>>>> >>> in the meantime I have measured the latencies introduced through
>>>>>> >>> messages sent and received by RT-Socket-CAN. The SJA1000 register
>>>>>> >>> access times on my rather old PC with an Athlon 1100 Mhz are:
>>>>>> >>>
>>>>>> >>> PEAK-Dongle: read  access: 11807 ns
>>>>>> >>> PEAK-Dongle: write access: 11677 ns
>>>>>> >>>
>>>>>> >>> IXXAT-PCI  : read  access:   729 ns
>>>>>> >>> IXXAT-PCI  : write access:   305 ns
>>>>>> >>>
>>>>>> >>> I measured an increase of the latency of approx. 170us with the
>>>>>> >>> PEAK-Dongle and approx 13us with the IXXAT-PCI card for the 
>>>>>> reception
>>>>>> >>> of a full CAN message (with 8 bytes payload). Sending messages 
>>>>>> is a
>>>>>> >>> bit less disturbing. I have attached a small patch to measure the
>>>>>> >>> SJA1000 register access times when the driver is initialized. 
>>>>>> You are
>>>>>> >>> welcome to apply it on your setup and report the results. I'm
>>>>>> >>> especially interested in numbers for the ISA bus (or PC-104).
>>>>>> >>>
>>>>>> >>> Wolfgang.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> 
>>>>>> ------------------------------------------------------------------------ 
>>>>>>
>>>>>> >>>
>>>>>> >>> + diff -u xenomai/ksrc/drivers/can/rtcan_dev.c.IOTEST
>>>>>> >>> xenomai/ksrc/drivers/can/rtcan_dev.c
>>>>>> >>> + diff -u xenomai/ksrc/drivers/can/sja1000/rtcan_sja1000.c.IOTEST
>>>>>> >>> xenomai/ksrc/drivers/can/sja1000/rtcan_sja1000.c
>>>>>> >>> --- xenomai/ksrc/drivers/can/sja1000/rtcan_sja1000.c.IOTEST
>>>>>> >>> 2007-02-26 09:17:27.000000000 +0100
>>>>>> >>> +++ xenomai/ksrc/drivers/can/sja1000/rtcan_sja1000.c    
>>>>>> 2007-03-13
>>>>>> >>> 10:01:47.000000000 +0100
>>>>>> >>> @@ -728,6 +728,30 @@
>>>>>> >>>      if (chip == NULL)
>>>>>> >>>      return -EINVAL;
>>>>>> >>>
>>>>>> >>> +#if 1
>>>>>> >>> +    {
>>>>>> >>> +    nanosecs_abs_t begin, diff;
>>>>>> >>> +    volatile u8 reg;
>>>>>> >>> +    int i, count = 100000;
>>>>>> >>> +    begin = rtdm_clock_read();
>>>>>> >>> +    for (i = 0; i < count; i++) {
>>>>>> >>> +        reg = chip->read_reg(dev, 0);
>>>>>> >>> +    }
>>>>>> >>> +    diff = rtdm_clock_read() - begin;
>>>>>> >>> +    printk("%s: register read time for %d accessed: %ld (%ld per
>>>>>> >>> access)\n",
>>>>>> >>> +           dev->board_name, count,
>>>>>> >>> +           (unsigned long)diff, (unsigned long)diff / count);
>>>>>> >>> +    begin = rtdm_clock_read();
>>>>>> >>> +    for (i = 0; i < count; i++) {
>>>>>> >>> +        chip->write_reg(dev, 0, reg);
>>>>>> >>> +    }
>>>>>> >>> +    diff = rtdm_clock_read() - begin;
>>>>>> >>> +    printk("%s: register write time for %d accessed: %ld (%ld 
>>>>>> per
>>>>>> >>> access)\n",
>>>>>> >>> +           dev->board_name, count,
>>>>>> >>> +           (unsigned long)diff, (unsigned long)diff / count);
>>>>>> >>> +    }
>>>>>> >>> +#endif
>>>>>> >>> +
>>>>>> >>>      /* Set dummy state for following call */
>>>>>> >>>      dev->state = CAN_STATE_ACTIVE;
>>>>>> >>>      /* Enter reset mode */
>>>>>> >>
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> _______________________________________________
>>>>>> Xenomai-help mailing list
>>>>>> Xenomai-help@domain.hid
>>>>>> https://mail.gna.org/listinfo/xenomai-help
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
> 
> 



  parent reply	other threads:[~2007-03-29 18:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13 10:52 [Xenomai-help] Latencies due to RT-Socket-CAN register accesses Wolfgang Grandegger
2007-03-13 13:16 ` [Xenomai-help] " Roland Tollenaar
2007-03-13 13:29   ` Wolfgang Grandegger
2007-03-13 13:41     ` Roland Tollenaar
2007-03-13 14:06       ` Wolfgang Grandegger
2007-03-14  9:33       ` Wolfgang Grandegger
2007-03-28 17:05       ` roland Tollenaar
2007-03-28 18:50         ` Wolfgang Grandegger
2007-03-29  2:17           ` Roland Tollenaar
2007-03-29  8:38             ` Stéphane ANCELOT
2007-03-29  8:59             ` Wolfgang Grandegger
2007-03-29 16:44               ` Roland Tollenaar
2007-03-29 18:51                 ` Gilles Chanteperdrix
2007-03-29 18:59                 ` Wolfgang Grandegger [this message]
2007-04-23 15:09                   ` [Xenomai-help] " roland Tollenaar
2007-04-23 18:28                     ` Gilles Chanteperdrix
2007-04-24  8:44                       ` roland Tollenaar
2007-04-24  8:56                         ` Gilles Chanteperdrix
2007-04-24 10:27                           ` roland Tollenaar
2007-04-24 10:27                             ` roland Tollenaar
2007-04-24 12:57                               ` Gilles Chanteperdrix
2007-04-24 18:36                                 ` roland Tollenaar
2007-04-24  9:05                         ` Jan Kiszka
2007-04-24 10:31                           ` roland Tollenaar
2007-04-24 10:51                             ` Jan Kiszka
2007-04-24 12:14                               ` roland Tollenaar
2007-04-24 12:32                                 ` Jan Kiszka
2007-04-24 10:57                             ` Wolfgang Grandegger
2007-04-24 11:00                               ` Jan Kiszka
2007-04-24 12:17                               ` roland Tollenaar
2007-04-24 12:19                                 ` roland Tollenaar
2007-04-24 12:44                                   ` Wolfgang Grandegger
2007-04-25  9:04                     ` Stéphane ANCELOT
2007-04-25 11:02                       ` Roland Tollenaar

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=460C0C7D.7000001@domain.hid \
    --to=wg@domain.hid \
    --cc=Xenomai-help@domain.hid \
    --cc=rolandtollenaar@domain.hid \
    /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.