interrupt latency

I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt handler
using InterruptAttach call. First what does interrupt handler is storing
the value from ClockCycles() in a statically allocated array of 40 000
elements. When array is filled up the program detaches interrupt handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange results:

  • when test is running in Photon without any user activity allmost all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these deviations
    are more often. Not all of them are so big (66us) but about 10 times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big interrupt
latency? Is it not normal for a real-time OS? Can I be sure that these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)

First, your interrupt can get delayed by other interrupts. Hence, the
latency that you see is determined by the execution time of interrupt
handlers in the system that uses an interrupt that has a higher priority.
You’d need to set the highest priority interrupt in the system to the one
that your ISA card uses. In QNX4, this was a built-in feature, in QNX6 it’s
not there anymore. You might be able to programm the interrupt controller
yourself. As far as I know nobody has tried that yet. I myself haven’t got
time to do it yet.

Also, there has been done a lot of work regarding the latency in the kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

Markus



“Alex Guryanow” <gav@ets.ifmo.ru> wrote in message
news:3B41D372.8D2241FE@ets.ifmo.ru

I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt handler
using InterruptAttach call. First what does interrupt handler is storing
the value from ClockCycles() in a statically allocated array of 40 000
elements. When array is filled up the program detaches interrupt handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange results:

  • when test is running in Photon without any user activity allmost all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these deviations
    are more often. Not all of them are so big (66us) but about 10 times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big interrupt
latency? Is it not normal for a real-time OS? Can I be sure that these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)

Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer when it is
configured to send events each 999 847 ns gives evens worse results (about 2
times).

May be I do something wrong? Otherwise I do’t understand how can be built a
predictable system using QNX!

Alex

Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt handler
using InterruptAttach call. First what does interrupt handler is storing
the value from ClockCycles() in a statically allocated array of 40 000
elements. When array is filled up the program detaches interrupt handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange results:

  • when test is running in Photon without any user activity allmost all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these deviations
    are more often. Not all of them are so big (66us) but about 10 times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big interrupt
latency? Is it not normal for a real-time OS? Can I be sure that these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)

Where do you actually get the info "latency is 1.38us for Pentium 200)?
Markus

“Alex Guryanow” <gav@ets.ifmo.ru> wrote in message
news:3B43259A.F4AA8C07@ets.ifmo.ru

Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the
kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer when
it is
configured to send events each 999 847 ns gives evens worse results (about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt handler
using InterruptAttach call. First what does interrupt handler is
storing
the value from ClockCycles() in a statically allocated array of 40 000
elements. When array is filled up the program detaches interrupt
handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange results:

  • when test is running in Photon without any user activity allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these deviations
    are more often. Not all of them are so big (66us) but about 10 times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure that these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)
\

Markus Loffler <loffler@ces.clemson.edu> wrote:

Where do you actually get the info "latency is 1.38us for Pentium 200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry

Markus



“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the
kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer when
it is
configured to send events each 999 847 ns gives evens worse results (about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt handler
using InterruptAttach call. First what does interrupt handler is
storing
the value from ClockCycles() in a statically allocated array of 40 000
elements. When array is filled up the program detaches interrupt
handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange results:

  • when test is running in Photon without any user activity allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these deviations
    are more often. Not all of them are so big (66us) but about 10 times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure that these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)
\

I couldn’t find any numbers there. Searching the knowledge base gave me
http://qdn.qnx.com/support/bok/solution.qnx?9497

However, these are just avarage latencies, there are not so useful
considering Alex’ problems.

Markus




“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9i5025$nmd$1@nntp.qnx.com

Markus Loffler <> loffler@ces.clemson.edu> > wrote:
Where do you actually get the info "latency is 1.38us for Pentium 200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry
Markus


“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the
kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer
when
it is
configured to send events each 999 847 ns gives evens worse results
(about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be
built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with
QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt
handler
using InterruptAttach call. First what does interrupt handler is
storing
the value from ClockCycles() in a statically allocated array of 40
000
elements. When array is filled up the program detaches interrupt
handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange
results:

  • when test is running in Photon without any user activity
    allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these
    deviations
    are more often. Not all of them are so big (66us) but about 10
    times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same
    as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure that
these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)


\

Markus Loffler wrote:

I couldn’t find any numbers there. Searching the knowledge base gave me
http://qdn.qnx.com/support/bok/solution.qnx?9497

However, these are just avarage latencies, there are not so useful
considering Alex’ problems.

I think average latencies are necessary for nobody. If I build a real-time
system then the customer can ask me how many time after issuing an interrupt the
hardware will wait for data. How can I answer this question if I know only
average latency? The average time is say 3us but may be it can be 3ms? Or 3s? I
need to know the worsest time. Where can I find these values? Or how they can be
calculated? I think that my case isn’t so difficult. Possible with commercial
version of QNX is shipped a documentation with this data?


Alex


Markus

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9i5025$nmd$> 1@nntp.qnx.com> …
Markus Loffler <> loffler@ces.clemson.edu> > wrote:
Where do you actually get the info "latency is 1.38us for Pentium 200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry
Markus


“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the
kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer
when
it is
configured to send events each 999 847 ns gives evens worse results
(about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be
built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with
QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt
handler
using InterruptAttach call. First what does interrupt handler is
storing
the value from ClockCycles() in a statically allocated array of 40
000
elements. When array is filled up the program detaches interrupt
handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange
results:

  • when test is running in Photon without any user activity
    allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these
    deviations
    are more often. Not all of them are so big (66us) but about 10
    times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same
    as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure that
these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)


\

Markus Loffler wrote:

I couldn’t find any numbers there.

In docs shipped with 6.1 I have not found these numbers too. But they was in 6.0
and can be found now
at
http://qdn.qnx.com/support/docs/neutrino/sys_arch/kernel.html#INTERRUPTHANDLING

Alex



Searching the knowledge base gave me
http://qdn.qnx.com/support/bok/solution.qnx?9497

However, these are just avarage latencies, there are not so useful
considering Alex’ problems.

Markus

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9i5025$nmd$> 1@nntp.qnx.com> …
Markus Loffler <> loffler@ces.clemson.edu> > wrote:
Where do you actually get the info "latency is 1.38us for Pentium 200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry
Markus


“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in the
kernel.
You should install RTP 6.1 right now. But please post again if your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer
when
it is
configured to send events each 999 847 ns gives evens worse results
(about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be
built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I have
writed a little test and now I’m confusing of its results. PC with
QNX
has a self-made ISA card that issues an interrupt (11) every ms. My
program gets the maximum FIFO-priority and sets an interrupt
handler
using InterruptAttach call. First what does interrupt handler is
storing
the value from ClockCycles() in a statically allocated array of 40
000
elements. When array is filled up the program detaches interrupt
handler
and writes this array to file. After that I analyze this file and
calculate intervals between each interrupt… and get strange
results:

  • when test is running in Photon without any user activity
    allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these
    deviations
    are more often. Not all of them are so big (66us) but about 10
    times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are killed
  • when test is running in text mode and almost all processes (same
    as
    upper +fontmanager) are killed the results are much better but not
    ideal: about every 10 seconds I see deviation in 6 us (what is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure that
these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3 Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)


\

Alex,
let me tell what I’ve found so far…

We have been using the drivers for the ServoToGo board for QNX4. I ported
them to QNX6. The real-time behavior seemed much worse. I got in touch with
one of the developers at QSSL who was improving the kernel latency. He fixed
a couple of things (e.g. a huge latency bug when allocating large shared
memory blocks). I more or less heard the same from different places “the
latency in QNX6 should be even better than in QNX4”. So far I can’t confirm
that from my own experience. However, since 6.1 just came out, I didn’t have
much time to do comparison.

If you are talking about the latency from interrupt to ISR (your original
e-mail), then you probably have to find out how to make the interrupt
highest order priority interrupt. However, usually you don’t do any work in
your ISR and send a pulse instead to some process. This process usually runs
at a high priority and does all the work. However, with this architecture,
the real-time behavior will be even worse, since this process can be
interrupted by any ISR. But with this architecture, we were able to build a
pretty stable system in QNX4.

I strongly feel that the following issues should be addressed by QSSL

  • How to set the highest order interrupt on Intel architectures
  • What are the worst case latencies in 6.1
  • Why do you see such big variations with your setup

Probably the latencies listed for 6.0 are the ones for the case that your
ISR does not get delayed by some other ISR, i.e., your ISR gets executed
right away. It’s hard to take other ISR’s into account, since the ISR of a
third party product could be of unkown execution time. However, one should
be able to calculate a worst-case model, taking the QSSL written ISR’s into
account.

Markus


“Alex Guryanow” <gav@ets.ifmo.ru> wrote in message
news:3B4AFC68.E365E11B@ets.ifmo.ru

Markus Loffler wrote:

I couldn’t find any numbers there.

In docs shipped with 6.1 I have not found these numbers too. But they was
in 6.0
and can be found now
at

http://qdn.qnx.com/support/docs/neutrino/sys_arch/kernel.html#INTERRUPTHANDL

ING

Alex



Searching the knowledge base gave me
http://qdn.qnx.com/support/bok/solution.qnx?9497

However, these are just avarage latencies, there are not so useful
considering Alex’ problems.

Markus

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9i5025$nmd$> 1@nntp.qnx.com> …
Markus Loffler <> loffler@ces.clemson.edu> > wrote:
Where do you actually get the info "latency is 1.38us for Pentium
200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry
Markus


“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency in
the
kernel.
You should install RTP 6.1 right now. But please post again if
your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again. Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with timer
when
it is
configured to send events each 999 847 ns gives evens worse results
(about
2
times).

May be I do something wrong? Otherwise I do’t understand how can be
built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I
have
writed a little test and now I’m confusing of its results. PC
with
QNX
has a self-made ISA card that issues an interrupt (11) every
ms. My
program gets the maximum FIFO-priority and sets an interrupt
handler
using InterruptAttach call. First what does interrupt handler
is
storing
the value from ClockCycles() in a statically allocated array of
40
000
elements. When array is filled up the program detaches
interrupt
handler
and writes this array to file. After that I analyze this file
and
calculate intervals between each interrupt… and get strange
results:

  • when test is running in Photon without any user activity
    allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds) they
    are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these
    deviations
    are more often. Not all of them are so big (66us) but about 10
    times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user
    plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are
    killed
  • when test is running in text mode and almost all processes
    (same
    as
    upper +fontmanager) are killed the results are much better but
    not
    ideal: about every 10 seconds I see deviation in 6 us (what is
    also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure
that
these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3
Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)



\

In the old days of real-time systems, you would buy a real-time computer
(like a modcomp) and they would provide you all the numbers for their
platform. Unfortunately, (or fortunately), with QNX supporting so many
different types of hardware, it is impossible for QSSL to provide these
numbers (other than baselines on some common hardware for comparisons).
The statement “latency is 1.38us for Pentium 200” refers only to the
kernels worst case interrupt dispatch latency on the specific processor.
This dispatch latency comes into play every time an interrupt (from any
source) occurs; thus the worst case delay that will be seen in practice
is (1.38 + longest handler exec time) * X (where X is the number of
hardware interrupts of a higher hardware priority than the one you are
interested in). Given this fact, it is impossible for any interrupt
(other than the highest hardware priority interrupt) to see an interrupt
dispatch latency of 1.38us on a Pentium 200.

The bottom line is that anyone developing a real-time system must
independently test (on the actual hardware in question) the execution
time of all handlers that have a higher hardware priority than the
handler for which a worst case time must be known, and do the above
calculation to determine what the worst case interrupt dispatch latency
will be in practice. QNX is a tool for developing real-time systems, it
does not do your work for you; it can’t (besides, that is why you get
the big bucks :slight_smile:. It would be nice if QSSL quoted the worst-case
execution paths for all of their drivers, but this would serve only to
reduce the number of drivers that QSSL could afford to support (not a
desirable situation, since I use QNX for development time, as well as
deployment time, and I want as few restrictions as possible on the types
of hardware I can use on my development box).

Again, back in the modcomp days all the hardware was designed to be
real-time as well, nowadays QSSL (by customer demand) provides drivers
for hardware that is far from ideal for real-time systems (in fact
real-time behavior was often never even considered when the hardware was
designed). Once again, it is your responsibility to choose hardware
with appropriate characteristics for your application.

-----Original Message-----
From: Alex Guryanow [mailto:gav@ets.ifmo.ru]
Posted At: Tuesday, July 10, 2001 5:47 AM
Posted To: os
Conversation: interrupt latency
Subject: Re: interrupt latency




Markus Loffler wrote:

I couldn’t find any numbers there. Searching the knowledge base gave
me
http://qdn.qnx.com/support/bok/solution.qnx?9497

However, these are just avarage latencies, there are not so useful
considering Alex’ problems.

I think average latencies are necessary for nobody. If I build a
real-time
system then the customer can ask me how many time after issuing an
interrupt the
hardware will wait for data. How can I answer this question if I know
only
average latency? The average time is say 3us but may be it can be 3ms?
Or 3s? I
need to know the worsest time. Where can I find these values? Or how
they can be
calculated? I think that my case isn’t so difficult. Possible with
commercial
version of QNX is shipped a documentation with this data?


Alex


Markus

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9i5025$nmd$> 1@nntp.qnx.com> …
Markus Loffler <> loffler@ces.clemson.edu> > wrote:
Where do you actually get the info "latency is 1.38us for Pentium
200)?

See the following doc in the helpviewer:
/QNX Neutrino OS 2.11/System Architecture/The Neutrino Microkernel/
Interrupt Handling/Interrupt Latency

Barry
Markus


“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B43259A.F4AA8C07@ets.ifmo.ru> …


Markus Loffler wrote:

Also, there has been done a lot of work regarding the latency
in the
kernel.
You should install RTP 6.1 right now. But please post again if
your
performance hasn’t changed.

I have just installed 6.1 and runned all tests again.
Unfortunately
nothing has
been changed.

Has anybody already played with interrupt priorities?

Last time I have forgotten to write that identical tests with
timer
when
it is
configured to send events each 999 847 ns gives evens worse
results
(about
2
times).

May be I do something wrong? Otherwise I do’t understand how can
be
built
a
predictable system using QNX!

Alex



Markus

“Alex Guryanow” <> gav@ets.ifmo.ru> > wrote in message
news:> 3B41D372.8D2241FE@ets.ifmo.ru> …
I have a standard QNX6 installation with patch C installed. I
have
writed a little test and now I’m confusing of its results. PC
with
QNX
has a self-made ISA card that issues an interrupt (11) every
ms. My
program gets the maximum FIFO-priority and sets an interrupt
handler
using InterruptAttach call. First what does interrupt handler
is
storing
the value from ClockCycles() in a statically allocated array
of 40
000
elements. When array is filled up the program detaches
interrupt
handler
and writes this array to file. After that I analyze this file
and
calculate intervals between each interrupt… and get strange
results:

  • when test is running in Photon without any user activity
    allmost
    all
    intervals are 1 ms, but sometimes (about every 6 seconds)
    they are
    greather : 1ms + ~66 us
  • when test is running in Photon and user plays Doom these
    deviations
    are more often. Not all of them are so big (66us) but about
    10
    times
    bigger than 1.38 us (as specified for 200 MHz Pentium)
  • the same results I get when test is running in Photon, user
    plays
    Doom
    and almost all processes (spooler, dumper, logger etc) are
    killed
  • when test is running in text mode and almost all processes
    (same
    as
    upper +fontmanager) are killed the results are much better
    but not
    ideal: about every 10 seconds I see deviation in 6 us (what
    is also
    bigger than 1.38 us)

And here are my questions: is it normal for QNX to have so
big
interrupt
latency? Is it not normal for a real-time OS? Can I be sure
that
these
deviations never will be bigger?

Alex

PS. QNX host is a PC with 600 MHz Celeron, 64 MB RAM, S3
Savage3D,
Micronet SP2080 PCI Ethernet card (Realtek8029AS)


\

Previously, Rennie Allen wrote in qdn.public.qnxrtp.os:

In the old days of real-time …

Well said. On top of all this, worst case latency can be
hindered by user supplied interrupt handlers, a cause for
delay that QSSL can neither report on nor predict.


Mitchell Schoenbrun --------- maschoen@pobox.com

“Mitchell Schoenbrun” <maschoen@pobox.com> wrote in message
news:Voyager.010710212442.18217B@schoenbrun.com

Previously, Rennie Allen wrote in qdn.public.qnxrtp.os:
In the old days of real-time …

Well said. On top of all this, worst case latency can be
hindered by user supplied interrupt handlers, a cause for
delay that QSSL can neither report on nor predict.

And not to mention, DMA operation, PCI master card,
SMM (or is it SMI) mode etc.

I think QNX is better not give a number, that way no one
can complain (and it happened before) the numbers weren’t
right :wink:

Mitchell Schoenbrun --------- > maschoen@pobox.com

Mitchell Schoenbrun wrote:

Previously, Rennie Allen wrote in qdn.public.qnxrtp.os:
In the old days of real-time …

Well said. On top of all this, worst case latency can be
hindered by user supplied interrupt handlers, a cause for
delay that QSSL can neither report on nor predict.

OK, I understand. It can therefore interrupt handlers be not necessary
in general? I think
this problem at all would not be, if interrupts were processed only
through messages. Because now the priorities system is broken by
interrupt handlers in drivers and user soft.

Alex


Mitchell Schoenbrun --------- > maschoen@pobox.com

Rennie Allen wrote:

This dispatch latency comes into play every time an interrupt (from any
source) occurs; thus the worst case delay that will be seen in practice
is (1.38 + longest handler exec time) * X (where X is the number of
hardware interrupts of a higher hardware priority than the one you are
interested in).

The bottom line is that anyone developing a real-time system must
independently test (on the actual hardware in question) the execution
time of all handlers that have a higher hardware priority than the
handler for which a worst case time must be known,

and how can be this tested?


and do the above
calculation to determine what the worst case interrupt dispatch latency
will be in practice. QNX is a tool for developing real-time systems,

but where then is here difference from common “office” OS, say Windows or
Linux?



it
does not do your work for you; it can’t (besides, that is why you get
the big bucks > :slight_smile:> . It would be nice if QSSL quoted the worst-case
execution paths for all of their drivers, but this would serve only to
reduce the number of drivers that QSSL could afford to support

why? are these drivers developped not by QSSL?


(not a
desirable situation, since I use QNX for development time, as well as
deployment time, and I want as few restrictions as possible on the types
of hardware I can use on my development box).

Ok, in develpment box one can use the hardware and drivers which interrupt
handling times are unknown, but in
working real-time system should be used only that hardware which latencies
are well known. IMHO.

Alex

“Alex Guryanow” <gav@ets.ifmo.ru> wrote in message
news:3B4C586F.B8C99A77@ets.ifmo.ru

Rennie Allen wrote:

This dispatch latency comes into play every time an interrupt (from any
source) occurs; thus the worst case delay that will be seen in practice
is (1.38 + longest handler exec time) * X (where X is the number of
hardware interrupts of a higher hardware priority than the one you are
interested in).

The bottom line is that anyone developing a real-time system must
independently test (on the actual hardware in question) the execution
time of all handlers that have a higher hardware priority than the
handler for which a worst case time must be known,

and how can be this tested?

Instrumented kernel.

and do the above
calculation to determine what the worst case interrupt dispatch latency
will be in practice. QNX is a tool for developing real-time systems,

but where then is here difference from common “office” OS, say Windows or
Linux?

From experience and by design QNX latency is smaller then most OS.
It doesn’t mean it’s highly predictable. System are getting way too complex
to become highly predictable.

it
does not do your work for you; it can’t (besides, that is why you get
the big bucks > :slight_smile:> . It would be nice if QSSL quoted the worst-case
execution paths for all of their drivers, but this would serve only to
reduce the number of drivers that QSSL could afford to support

why? are these drivers developped not by QSSL?

This take lots of time to test. Plus it also mean everytime a single line
of relavent code is modified the whole testing has to be done all over
again.
Very time consuming. QA already seems to have their hands full :wink:

(not a
desirable situation, since I use QNX for development time, as well as
deployment time, and I want as few restrictions as possible on the types
of hardware I can use on my development box).

Ok, in develpment box one can use the hardware and drivers which interrupt
handling times are unknown, but in
working real-time system should be used only that hardware which latencies
are well known. IMHO.

Yes but how QNX can tell which hardware you’ve decide to use? Hence
their number would be meaningless anyway. Further more, since latency
is also affected by hardware (chipset) tracking this info (if it’s available
in the
first place) would be a real nightmare.


Alex

Previously, Mario Charest wrote in qdn.public.qnxrtp.os:

And not to mention, DMA operation, PCI master card,
SMM (or is it SMI) mode etc.

How true. For the familiar, DMA can steal a percentage of
the bus, usually on a predicatable basis. There is a
“burst” mode that could be a serious problem with hard real
time. SMM/SMI (I don’t recall which it is either) is either
in your system or not. If it is in your system, it may not
affect you. If it it does, it just takes over and there’s
almost nothing you can do about it.

I think QNX is better not give a number, that way no one
can complain (and it happened before) the numbers weren’t
right > :wink:

Mitchell Schoenbrun --------- maschoen@pobox.com

Previously, Alex Guryanow wrote in qdn.public.qnxrtp.os:

OK, I understand. It can therefore interrupt handlers be not necessary
in general? I think
this problem at all would not be, if interrupts were processed only
through messages. Because now the priorities system is broken by
interrupt handlers in drivers and user soft.

Well QSSL seems to recommend that you limit your interrupt handler
to as little code as possible. In the extreme as you seem to suggest
you could always trigger a pulse, and then let the scheduler decide
which code will run. This gives you maximum control. It would be nice
if QSSL would publish some details on the load each driver might
place on the system. If ever the sources are released, the answers
will be available. They could potentially even show us the interrupt
handlers for otherwise un-releaseable drivers.


Mitchell Schoenbrun --------- maschoen@pobox.com

QNX6 allows you to attach an event directly to a hardware interrupt
(InterruptAttachEvent) without providing an interrupt handler, so that
there is, in effect, no interrupt dispatch latency at all (i.e. the
interrupt is handled completely in kernel context, and the event is
queued to the process that attached it, with scheduling occurring as
expected). It is quite simply impossible to be any “more” of an RTOS in
this respect. It is probably because of this capability that it was
decided not to allow setting of the hardware priority, since this
capability enables use of the OS priority structure with interrupt
handlers (better in many ways - and certainly more portable - than being
able to set some “foreign” h/w based priority).

-----Original Message-----
From: Mitchell Schoenbrun [mailto:maschoen@pobox.com]
Posted At: Wednesday, July 11, 2001 10:17 AM
Posted To: os
Conversation: interrupt latency
Subject: Re: interrupt latency


Previously, Alex Guryanow wrote in qdn.public.qnxrtp.os:

OK, I understand. It can therefore interrupt handlers be not necessary
in general? I think
this problem at all would not be, if interrupts were processed only
through messages. Because now the priorities system is broken by
interrupt handlers in drivers and user soft.

Well QSSL seems to recommend that you limit your interrupt handler
to as little code as possible. In the extreme as you seem to suggest
you could always trigger a pulse, and then let the scheduler decide
which code will run. This gives you maximum control. It would be nice
if QSSL would publish some details on the load each driver might
place on the system. If ever the sources are released, the answers
will be available. They could potentially even show us the interrupt
handlers for otherwise un-releaseable drivers.


Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun wrote:

Previously, Mario Charest wrote in qdn.public.qnxrtp.os:

And not to mention, DMA operation, PCI master card,
SMM (or is it SMI) mode etc.


For the familiar, DMA can steal a percentage of
the bus, usually on a predicatable basis. There is a
“burst” mode that could be a serious problem with hard real
time. SMM/SMI (I don’t recall which it is either) is either

Sorry for a possible dumb question, but wat is it SMM/SMI?

And I think, that if DMA can bring so many problems then it can be
disabled (standard installation of QNX has this option)

Alex

Rennie Allen wrote:

QNX6 allows you to attach an event directly to a hardware interrupt
(InterruptAttachEvent) without providing an interrupt handler, so that
there is, in effect, no interrupt dispatch latency at all (i.e. the
interrupt is handled completely in kernel context, and the event is
queued to the process that attached it, with scheduling occurring as
expected).

Yes it’s all right, but are you shure that drivers for keyboard, mouse,
network,
harddisk etc do not use InterruptAttach function? I think it will be better,
if this fucntion (InterruptAttach) does not exist at all.

Alex