From: Anders Blomdell <anders.blomdell@domain.hid>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Big differences in analogy interrupt handling time
Date: Fri, 16 Dec 2011 12:49:31 +0100 [thread overview]
Message-ID: <4EEB304B.2010108@domain.hid> (raw)
In-Reply-To: <CAMwkeZw4X15HU7ABUhvLpXuu1Sbspen6FK7XvjHiQLXg0AcazQ@mail.gmail.com>
On 12/15/2011 06:28 PM, Fernando Herrero Carrón wrote:
> 2011/12/15 Anders Blomdell<anders.blomdell@domain.hid>
>
> Hi,
>>
>> I'm trying to tweak out good performance with Analogy and a NI-6221 card,
>> and after getting weird results with the attached program (long and very
>> varying interrupt latencies). The machine I'm running on is a 'Intel(R)
>> Core(TM)2 CPU 6420 @ 2.13GHz', no frequency scaling, no X, low load, only
>> one CPU enabled to minimize influence from other Linux tasks. As can be
>> seen from the frozen traces (formatted and time shifted to be examined with
>> 'pr -mtT -w 200 A B'), the time spent in the interrupt handling varies
>> between 263 and 329 us and there is variation even in repeated code paths
>> [which are bogus in themselves, why busy-wait 10 us in an interrupt
>> routine?], so cache poisoning should not be the issue.
>>
>> Anybody that has any insights to share?
>>
>>
> Hi everyone there,
>
> In fact, I came accross this same issue some months ago, but haven't had
> time to write on the list up to now.
>
> Actually, there seems to be some old inherited code from the early comedi
> days. In the file ksrc/drivers/analogy/national_instruments/mio_common.c
> there is a function that handles transfers called "ni_handle_eos()". You
> can see:
>
> static void ni_handle_eos(a4l_subd_t *subd)
> {
> a4l_dev_t *dev = subd->dev;
>
> if (devpriv->aimode == AIMODE_SCAN) {
> static const int timeout = 10;
> int i;
>
> for (i = 0; i< timeout; i++) {
> ni_sync_ai_dma(subd);
> /* TODO: stop when the transfer is really over */
> a4l_udelay(1);
> }
> }
>
> /* Handle special case of single scan using AI_End_On_End_Of_Scan */
> if ((devpriv->ai_cmd2& AI_End_On_End_Of_Scan)) {
> shutdown_ai_command(subd);
> }
> }
>
> Just remove the "for" loop and the a4l_udelay, and leave
> ni_sync_ai_dma(subd):
>
> static void ni_handle_eos(a4l_subd_t *subd)
> {
> a4l_dev_t *dev = subd->dev;
>
> if (devpriv->aimode == AIMODE_SCAN) {
> static const int timeout = 10;
> int i;
timeout and i should also be removed.
>
> ni_sync_ai_dma(subd);
> }
>
> /* Handle special case of single scan using AI_End_On_End_Of_Scan */
> if ((devpriv->ai_cmd2& AI_End_On_End_Of_Scan)) {
> shutdown_ai_command(subd);
> }
> }
>
> This is working for me, for the time being.
>
> Hope this helps,
Nice that somebody has already tested this.
Nobody that has any insight on what might slow down execution with 20%
(curious mind wants to know)?
/Anders
--
Anders Blomdell Email: anders.blomdell@domain.hid
Department of Automatic Control
Lund University Phone: +46 46 222 4625
P.O. Box 118 Fax: +46 46 138118
SE-221 00 Lund, Sweden
next prev parent reply other threads:[~2011-12-16 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 13:59 [Xenomai-help] Big differences in analogy interrupt handling time Anders Blomdell
2011-12-15 17:28 ` Fernando Herrero Carrón
2011-12-16 11:49 ` Anders Blomdell [this message]
2011-12-16 11:57 ` Fernando Herrero Carrón
2011-12-16 12:14 ` Anders Blomdell
2011-12-16 12:30 ` Fernando Herrero Carrón
2011-12-16 12:16 ` Fernando Herrero Carrón
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=4EEB304B.2010108@domain.hid \
--to=anders.blomdell@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.