Priority inversion problem?

I have a priority problem that I haven’t been able to solve.
I’m writing a resource manager for FireWire devices, using the
Mindready LLA package. It works as long as a terminal window
isn’t scrolling. (Scrolling is very slow, and CPU-bound,
since the VESA driver is driving the screen.) If there’s
any scrolling, the driver doesn’t get serviced fast enough
and misses packets.

All the important threads in the driver are at priority 11
to 13. The thead that processes I/O requests isn’t involved
in receiving packets. Packets are coming in continuously from
a camera, and the receiving interrupt is handled by a thread.
So the receive side free-runs. Yet lower-priority work
seems to be starving it of CPU time.

There’s a logging thread running at 9, and it
does all the printing, so that shouldn’t affect anything.
Nothing blocks waiting for the logger (it’s written to discard,
not block, if the log queue is full), so that’s not the
problem. As far as I can tell, nothing associated with
the terminal or Photon is higher than priority 10.

I’m missing something. Suggestions?

John Nagle
Animats

John Nagle <nagle@downside.com> wrote:

I have a priority problem that I haven’t been able to solve.
I’m writing a resource manager for FireWire devices, using the
Mindready LLA package. It works as long as a terminal window
isn’t scrolling. (Scrolling is very slow, and CPU-bound,
since the VESA driver is driving the screen.) If there’s
any scrolling, the driver doesn’t get serviced fast enough
and misses packets.

All the important threads in the driver are at priority 11
to 13. The thead that processes I/O requests isn’t involved
in receiving packets. Packets are coming in continuously from
a camera, and the receiving interrupt is handled by a thread.
So the receive side free-runs. Yet lower-priority work
seems to be starving it of CPU time.

There’s a logging thread running at 9, and it
does all the printing, so that shouldn’t affect anything.
Nothing blocks waiting for the logger (it’s written to discard,
not block, if the log queue is full), so that’s not the
problem. As far as I can tell, nothing associated with
the terminal or Photon is higher than priority 10.

The graphics driver runs at 12. And it’s the graphics driver that does
the scrolling.