Re: Visible Ctrl-C in latest kernels

From: Joe Peterson
Date: Mon Aug 25 2008 - 10:30:18 EST


Willy Tarreau wrote:
> not mine, I was speaking about your patch of 2008/02/06 which was
> talked about earlier in this thread. I was thinking that it was
> possible that the signal got delayed when it was hard to print
> ^C because the output was already busy spewing a stream of data.
> Maybe I'm wrong, but I mean it does not cost much to try to revert
> this patch when the problem is encountered. And I keep in mind
> that it is possible, as you say, that your patch only makes the
> problem more visible.

Actually, funny you mention the case when output is busy. This actually
will not cause any delay of the signal, but it instead causes the echo
(not the signal) to be thrown away in the current code. If the tty
driver's buffer is full, the attempted write simply returns - nothing is
held. The signal is still sent right away.

Now, this loss of the echo is a problem in itself, not because it delays
the signals, but because the echo will not be displayed. Echo is also
lost when the tty is stopped (but the signal chars restart the tty, so
you will only see this for regular chars typed after, say, a ctrl-s)).

I have another patch out that will fix the lost echo issue:

http://marc.info/?l=linux-kernel&m=121924672730143&w=2

Note that this patch also will never cause any delay of the signals. In
fact, it places the echo character in a buffer so that a full or stopped
tty buffer will not cause the echoed char to be immediately discarded.
The signal, same as now, is always immediately issued - no delay.

-Joe
--
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/