Re: [PATCH 0/2] [RFC] RT: Optionally allow IRQF_NODELAY on serial console




--
On Fri, 5 Oct 2007, Thomas Gleixner wrote:

On Fri, 5 Oct 2007, Gregory Haskins wrote:
This series may help debugging certain circumstances where the serial
console is unreponsive (e.g. RT51+ spinner, or scheduler problem). It changes
the serial8250 driver to use IRQF_NODELAY so that interrupts execute in irq
context instead of a kthread.

It works pretty well on this end, though it is admitted not fully baked. For
instance, a few paths in sysrq can still call into non-raw spinlocks
(sched_debug_show, for instance) which will cause subsequent errors. Also,
if you use KDB, be sure to convert the kdb_printf_lock to raw as well. I may
send a KDB related patch seperately.

I am sending this out now in case it is helpful to someone.

The simple non-patch solution is to up the priority of the serial
console irq to maximum. That's usually sufficient to catch runnaway tasks
etc. It does not interfere with the system in normal operation as long as
you do not hit keys in your minicom.

I doubt that your patch has a chance to survive lockdep and anything which
is not a sysrq.

This issue has hit me enough times where I've played with a few other
ideas. I just haven't had the time to finish them. The main problem is if
the system locks up somewhere we have a lock held that keeps us from
scheduling. Once that happens in -rt, we are as good as dead. Since you
can't get much info out without a JTAG or some other mechanism.

One thought I had was to create a small handler that could read the serial
and place data into a buffer. This handler would be a IRQ_NODELAY, and it
would wake up a serial thread to handle the data just like it would for
normal serial output. But the serial thread would just read from the
buffer instead of the serial itself. In the case of a sysrq key coming
in, the IRQ_NODELAY handler would handle it.

Just a thought. Maybe someday I can get time to play more with this idea,
or someone else can come up with one. But to convert the entire handler
into nodelay is a bit extreme.

-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: SetConsoleCtrlHandler
    ... I've stressed to the customer they must do extensive testing ... console logoff events. ... This modified handler does not call ... This allows the service to continue running after the user logs ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Notification of timezone change
    ... inside the message handler to retrieve it again and compare with cached value, ... settings, this parameter points to the string "intl". ... For a console application, you may implement a "listener" thread (this is the ... When this receiver window gets the message, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: SetConsoleCtrlHandler
    ... First of all the system isn't shutting down, ... application isn't a service and is not associated with a console. ... This modified handler does not call ... This allows the service to continue running after the user logs ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Responding to CTRL_CLOSE_EVENT when the application is blocked
    ... > to close the console of your character-mode application, ... The handler gets called in a separate ... The only solution I have come up with is to close the standard ... > support asynchronous operation. ...
    (microsoft.public.win32.programmer.ui)
  • [RFC/PATCH] sysrq: secondary sysrq key table
    ... Ingo noticed that the sysrq table is close to filling up. ... static int sysrq_alt_use; ... -handler function you will use, B) a help_msg string, that will print when SysRQ ... +handler function you will use, B) a help_msg string that will print when SysRQ ...
    (Linux-Kernel)