public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Peterson <joe@skyrush.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: tty: ctrl-c not always echoed, especially under load
Date: Mon, 11 Aug 2008 11:41:32 -0600	[thread overview]
Message-ID: <48A079CC.5020508@skyrush.com> (raw)
In-Reply-To: <20080811173911.07a3a9c5@lxorguk.ukuu.org.uk>

Alan Cox wrote:
> First thought would be to simply fire all output through your buffer in
> n_tty. It's not a performance critical bit of code and it would still be
> fast as the usual case would be
> 
> 	if (queue->length == 0)
> 		try_write_directly(...)

Only problem with that is that with a steady stream of output, you would likely
end up quickly filling the new buffer and be right back to the same issue of
losing echos and other ldisc chars off the start of the buf.  Also, the regular
output channel has the mechanism to throttle itself already and try again later
(causing the upstream process to wait as expected - example: ping foo.com; hit
^S; it stops pinging until ^Q...).

What I may try is moving the code that manipulates the column marker (mostly
"eraser") to happen at real output (i.e. when we know space is available), and
have all ldisc echos/chars go into the buffer initially.  That way, the regular
output stream and ldisc stream (out of the buffer) will be able to control the
column stuff properly and in sync.  By knowing how many chars need to go out
(eraser is the only non-trivial case, and we can have it tell us the char string
before sending it), we can be sure there is space before trying and subsequently
changing the column.

BTW, I'll also need to call the new buffer push function periodically after the
output happens in case there are characters left to process.  I suspect the
right place is in the write wakeup func or the poll func.  If you know off hand,
let me know.

						Thanks, Joe

  reply	other threads:[~2008-08-11 17:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 22:03 tty: ctrl-c not always echoed, especially under load Joe Peterson
2008-08-04 23:11 ` Alan Cox
2008-08-04 23:36   ` Joe Peterson
2008-08-06 20:17   ` Joe Peterson
2008-08-07 19:37     ` Alan Cox
2008-08-07 20:31       ` Joe Peterson
2008-08-11 15:14       ` Joe Peterson
2008-08-11 16:39         ` Alan Cox
2008-08-11 17:41           ` Joe Peterson [this message]
2008-08-14 16:19           ` [PATCH] " Joe Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A079CC.5020508@skyrush.com \
    --to=joe@skyrush.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox