All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ?
       [not found] <FA4CEC4EBE2FA145A7663764A1CCB31E5C4C8FBB@VOITV-EXCH-BE01.transas.com>
@ 2013-02-12 12:33 ` Zemskov, Evgeny
  2013-02-12 12:45   ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: Zemskov, Evgeny @ 2013-02-12 12:33 UTC (permalink / raw)
  To: xenomai

Good evening !

We're developing a system with bunch of Xenomai threads, one of which writes
the data to some specific device (MIL-STD-1553B bus controller).

RTDM drivers for this device are not available, and we want to avoid porting
them to RTDM.
Since we don't need to wait for any interrupts from this device (we init the
transmission with some ioctl's which write to the registers of the device and
write the data being tarnsmitted with __copy_from_user), we've tried to use
standard Linux drived from Xenomai thread.
Naturally, on each transmission, the transmitting Xenomai thread switches to
the secondary mode, but the resulting latency is perfectly OK for us (we
estimate it at around 50..100 usec).

Would such approach cause extra latencies to other Xenomai threads, which run
 simultaneously in primary mode ?
Also, would there be any problems with constant switches of our writer thread
between primary and secondary mode ?
As far as I understand, on each register access it is switched to secondary
mode, and on each rt_cond_wait it goes back to primary mode.

Thanks once again.

Eugene


Evgeny Zemskov, Transas Ltd
evgeny.zemskov@transas.com
Office phone # +7 812 3253131 add. 274-03
Cell phone # +7 952 3943129

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ?
  2013-02-12 12:33 ` [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ? Zemskov, Evgeny
@ 2013-02-12 12:45   ` Gilles Chanteperdrix
  2013-02-15 11:09     ` Zemskov, Evgeny
  0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2013-02-12 12:45 UTC (permalink / raw)
  To: Zemskov, Evgeny; +Cc: xenomai

On 02/12/2013 01:33 PM, Zemskov, Evgeny wrote:

> Good evening !
> 
> We're developing a system with bunch of Xenomai threads, one of which writes
> the data to some specific device (MIL-STD-1553B bus controller).
> 
> RTDM drivers for this device are not available, and we want to avoid porting
> them to RTDM.
> Since we don't need to wait for any interrupts from this device (we init the
> transmission with some ioctl's which write to the registers of the device and
> write the data being tarnsmitted with __copy_from_user), we've tried to use
> standard Linux drived from Xenomai thread.
> Naturally, on each transmission, the transmitting Xenomai thread switches to
> the secondary mode, but the resulting latency is perfectly OK for us (we
> estimate it at around 50..100 usec).


You probably should not expect a bounded latency from Linux.

> 
> Would such approach cause extra latencies to other Xenomai threads, which run
>  simultaneously in primary mode ?


If you enable CONFIG_XENO_OPT_PRIOCPL and the task running in secondary
mode has a higher priority than other Xenomai threads, then yes.
Otherwise no.

> Also, would there be any problems with constant switches of our writer thread
> between primary and secondary mode ?


It depends on your definition of "problems":
- such a task can not be considered a real-time task
- and the constant switches induces a bit of CPU consumption.

> As far as I understand, on each register access it is switched to secondary
> mode, and on each rt_cond_wait it goes back to primary mode.


You understand right.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ?
  2013-02-12 12:45   ` Gilles Chanteperdrix
@ 2013-02-15 11:09     ` Zemskov, Evgeny
  0 siblings, 0 replies; 3+ messages in thread
From: Zemskov, Evgeny @ 2013-02-15 11:09 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Thank you !

Of course, we won't expect  bounded latencies from our thread that uses Linux driver; 
but I believe to be able to measure the load on our sytem and test in under such load 
for some time and check if our write latencies are still OK.
Another solution (which also worked satisfactory so far) was to 'exhaust' our data to a
 Linux process via a rt_pipe and write it in 'proper' way.

The most important part of the question and the answer that it would'nt affect other
 threads in primary mode.


Eugene

Evgeny Zemskov, Transas Ltd
evgeny.zemskov@transas.com
Office phone # +7 812 3253131 add. 274-03
Cell phone # +7 952 3943129

________________________________________
From: Gilles Chanteperdrix [gilles.chanteperdrix@xenomai.org]
Sent: Tuesday, February 12, 2013 4:45 PM
To: Zemskov, Evgeny
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ?

On 02/12/2013 01:33 PM, Zemskov, Evgeny wrote:

> Good evening !
>
> We're developing a system with bunch of Xenomai threads, one of which writes
> the data to some specific device (MIL-STD-1553B bus controller).
>
> RTDM drivers for this device are not available, and we want to avoid porting
> them to RTDM.
> Since we don't need to wait for any interrupts from this device (we init the
> transmission with some ioctl's which write to the registers of the device and
> write the data being tarnsmitted with __copy_from_user), we've tried to use
> standard Linux drived from Xenomai thread.
> Naturally, on each transmission, the transmitting Xenomai thread switches to
> the secondary mode, but the resulting latency is perfectly OK for us (we
> estimate it at around 50..100 usec).


You probably should not expect a bounded latency from Linux.

>
> Would such approach cause extra latencies to other Xenomai threads, which run
>  simultaneously in primary mode ?


If you enable CONFIG_XENO_OPT_PRIOCPL and the task running in secondary
mode has a higher priority than other Xenomai threads, then yes.
Otherwise no.

> Also, would there be any problems with constant switches of our writer thread
> between primary and secondary mode ?


It depends on your definition of "problems":
- such a task can not be considered a real-time task
- and the constant switches induces a bit of CPU consumption.

> As far as I understand, on each register access it is switched to secondary
> mode, and on each rt_cond_wait it goes back to primary mode.


You understand right.

--
                                                                Gilles.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-15 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <FA4CEC4EBE2FA145A7663764A1CCB31E5C4C8FBB@VOITV-EXCH-BE01.transas.com>
2013-02-12 12:33 ` [Xenomai] Would a Xenomai thread running in secondary mode affect the latencies of other Xenomai threads in primary modes ? Zemskov, Evgeny
2013-02-12 12:45   ` Gilles Chanteperdrix
2013-02-15 11:09     ` Zemskov, Evgeny

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.