All of lore.kernel.org
 help / color / mirror / Atom feed
* RT_PREEMPT autodetection from user program
@ 2013-01-20  0:49 Michael Haberler
  2013-01-20  1:56 ` Sven-Thorsten Dietrich
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael Haberler @ 2013-01-20  0:49 UTC (permalink / raw)
  To: linux-rt-users

Hi,

I need to autodetect the RT kernel for an application which runs under RTAI, Xenomai, RT_PREEMPT and vanilla kernels. 

To support a unified binary, I need to runtime detect the RT OS - what are my best options for RT_PREEMPT? from https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#Checking_the_Kernel I gather the single method:

parsing 'ps' output for IRQ handlers being kthreads, i.e. for '[IRQ' or '[irq'

any chance of doing better than that, or parsing of utsname.release for "-rt"?  A false positive on a vanilla kernel could be a safety hazard.

thanks in advance,

Michael



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

* Re: RT_PREEMPT autodetection from user program
  2013-01-20  0:49 RT_PREEMPT autodetection from user program Michael Haberler
@ 2013-01-20  1:56 ` Sven-Thorsten Dietrich
  2013-01-20  9:49 ` Stanislav Meduna
  2013-01-21 15:37 ` Clark Williams
  2 siblings, 0 replies; 5+ messages in thread
From: Sven-Thorsten Dietrich @ 2013-01-20  1:56 UTC (permalink / raw)
  To: Michael Haberler; +Cc: linux-rt-users


On Jan 19, 2013, at 4:49 PM, Michael Haberler <mail17@mah.priv.at> wrote:

> Hi,
> 
> I need to autodetect the RT kernel for an application which runs under RTAI, Xenomai, RT_PREEMPT and vanilla kernels. 
> 
> To support a unified binary, I need to runtime detect the RT OS - what are my best options for RT_PREEMPT? from https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#Checking_the_Kernel I gather the single method:
> 
> parsing 'ps' output for IRQ handlers being kthreads, i.e. for '[IRQ' or '[irq'
> 
> any chance of doing better than that, or parsing of utsname.release for "-rt"?  A false positive on a vanilla kernel could be a safety hazard.
> 

Not sure what distro you are supporting and so on, but zcat /proc/config.gz | grep PREEMPT_RT might work.


Sven



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

* Re: RT_PREEMPT autodetection from user program
  2013-01-20  0:49 RT_PREEMPT autodetection from user program Michael Haberler
  2013-01-20  1:56 ` Sven-Thorsten Dietrich
@ 2013-01-20  9:49 ` Stanislav Meduna
  2013-01-20 12:43   ` Michael Mueller
  2013-01-21 15:37 ` Clark Williams
  2 siblings, 1 reply; 5+ messages in thread
From: Stanislav Meduna @ 2013-01-20  9:49 UTC (permalink / raw)
  To: linux-rt-users

On 20.01.2013 01:13, John Morris wrote:

> LCNC drives machines that weigh many tons and spins
> spindles at 24k RPM, so this is important!
...
> We haven't found /proc/config.gz in any vendor-provided
> PREEMPT_RT kernels, so that is not an option either.

On 20.01.2013 01:49, Michael Haberler wrote:

> A false positive on a vanilla kernel could be a safety hazard.

If we are speaking safety here I'd say that you have to support
specific version of kernel on specific hardware that _you_ have
quality assured. Anything else is a recipe for problems.

I've seen OSADL Linux deadlock, RT PREEMPT leaking memory,
RT PREEMPT on but without high-res timers, IDE driver
monopolizing processor so that the RT throttler was activated,
priority inversion issues between kernel and application
threads, interrupt latencies due to interrupt routing
on the specific hardware etc.

There is no way you can guarantee anything if you are using
vendor-provided kernel on a hardware you have never seen.
With your kernel, a list of supported hardware, with initscripts
that are checking if the environment matches and with the help
from this list (thank you guys, the level of support here
is excellent!) you will sleep a lot better.

Just my two cents

Regards
-- 
                                        Stano


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

* Re: RT_PREEMPT autodetection from user program
  2013-01-20  9:49 ` Stanislav Meduna
@ 2013-01-20 12:43   ` Michael Mueller
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Mueller @ 2013-01-20 12:43 UTC (permalink / raw)
  To: Stanislav Meduna; +Cc: linux-rt-users

On Sun, Jan 20, 2013 at 4:49 AM, Stanislav Meduna <stano@meduna.org> wrote:
>
> On 20.01.2013 01:13, John Morris wrote:
>
> > LCNC drives machines that weigh many tons and spins
> > spindles at 24k RPM, so this is important!

> On 20.01.2013 01:49, Michael Haberler wrote:
>
> > A false positive on a vanilla kernel could be a safety hazard.
>
> If we are speaking safety here I'd say that you have to support
> specific version of kernel on specific hardware that _you_ have
> quality assured. Anything else is a recipe for

catastrophic failure.

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

* Re: RT_PREEMPT autodetection from user program
  2013-01-20  0:49 RT_PREEMPT autodetection from user program Michael Haberler
  2013-01-20  1:56 ` Sven-Thorsten Dietrich
  2013-01-20  9:49 ` Stanislav Meduna
@ 2013-01-21 15:37 ` Clark Williams
  2 siblings, 0 replies; 5+ messages in thread
From: Clark Williams @ 2013-01-21 15:37 UTC (permalink / raw)
  To: Michael Haberler; +Cc: linux-rt-users

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

On Sun, 20 Jan 2013 01:49:59 +0100
Michael Haberler <mail17@mah.priv.at> wrote:

> Hi,
> 
> I need to autodetect the RT kernel for an application which runs under RTAI, Xenomai, RT_PREEMPT and vanilla kernels. 
> 
> To support a unified binary, I need to runtime detect the RT OS - what are my best options for RT_PREEMPT? from https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#Checking_the_Kernel I gather the single method:
> 
> parsing 'ps' output for IRQ handlers being kthreads, i.e. for '[IRQ' or '[irq'
> 
> any chance of doing better than that, or parsing of utsname.release for "-rt"?  A false positive on a vanilla kernel could be a safety hazard.
> 
>

A PREEMPT_RT kernel creates /sys/kernel/realtime when it boots. You
can just check for the existence of that file.

Clark

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2013-01-21 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20  0:49 RT_PREEMPT autodetection from user program Michael Haberler
2013-01-20  1:56 ` Sven-Thorsten Dietrich
2013-01-20  9:49 ` Stanislav Meduna
2013-01-20 12:43   ` Michael Mueller
2013-01-21 15:37 ` Clark Williams

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.