2011/10/4 Julien Delange <[email protected]>

> On Tue, Oct 4, 2011 at 7:16 AM, Gilles Chanteperdrix
> <[email protected]> wrote:
> > I am sorry, I do not really understand what you are doing, what has
> > CONFIG_HZ to do with your issue?
>
> I was wondering if this configuration item may have an impact on the
> kernel scheduling speed.
>
>
> > Could you post a self-contained example allowing to reproduce the issue
> > you observe?
>
> So, basically, I just create a start a native xenomai thread :
>   rt_task_create(&task, "Read IO Card", 0, 99, T_FPU);
>   rt_task_start (&task, &polling_task, 0);
>
>
> And then, the task itself performs a loop that acquires data on a
> periodic basis of 1ms (see code below).
> The problem is that when I run the code, the value of missed in either
> 1 or 2, meaning that the deadline expired and the task does not meet
> its timing requirements.
>
> So, if you have any suggestion/comments to improve this code or how
> kernel configuration may impact the performance of such piece of code,
> it would be very interesting.
>
>
Dear Julien,

In my opinion, instruction lists are definitely not the way to go for high
speed acquisitions. The cost of setting up an instruction (from a
kernel/board perspective, not from the user perspective) is very high and it
is linear with the number of channels. At this point you want to consider
using the "command" infrastructure, which will provide DMA transferred
acquisitions.

In your case, you can take advantage of your DAQ board's clock and set it up
to provide you with precisely timed data. Then you have to decide whether
you care more about throughput or lattency. In the first case you can
achieve higher transfer rates using larger transfer blocks. In the second
case, you will have to use smaller transfer blocks, either with
"a4l_set_wake_size()" (or similar, I don't recall right now) or configuring
your board with the TRIG_WAKE_EOS flag.

Finally, you won't strictly need to program a periodic task. Using blocking
xenomai-syscalls you will be able to acquire the DAQ-timed data properly.

I hope this helps.

Good luck,
Fernando
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to