1
0
Fork 0
alistair23-linux/drivers/tty
Linus Torvalds a5660b41af tty: fix endless work loop when the buffer fills up
Commit f23eb2b2b2 ('tty: stop using "delayed_work" in the tty layer')
ended up causing hung machines on UP with no preemption, because the
work routine to flip the buffer data to the ldisc would endlessly re-arm
itself if the destination buffer had filled up.

With the delayed work, that only caused a timer-driving polling of the
tty state every timer tick, but without the delay we just ended up with
basically a busy loop instead.

Stop the insane polling, and instead make the code that opens up the
receive room re-schedule the buffer flip work.  That's what we should
have been doing anyway.

This same "poll for tty room" issue is almost certainly also the cause
of excessive kworker activity when idle reported by Dave Jones, who also
reported "flush_to_ldisc executing 2500 times a second" back in Nov 2010:

  http://lkml.org/lkml/2010/11/30/592

which is that silly flushing done every timer tick.  Wasting both power
and CPU for no good reason.

Reported-and-tested-by: Alexander Beregalov <a.beregalov@gmail.com>
Reported-and-tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: Greg KH <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-04-04 14:26:54 -07:00
..
hvc drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
ipwireless Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-03-16 15:11:04 -07:00
serial apbuart: Depend upon sparc. 2011-03-30 21:12:24 -07:00
vt lib, arch: add filter argument to show_mem and fix private implementations 2011-03-24 17:49:37 -07:00
Kconfig tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
Makefile tty: move ipwireless driver from drivers/char/pcmcia/ to drivers/tty/ 2011-02-22 16:23:22 -08:00
amiserial.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
bfin_jtag_comm.c drivers/tty/bfin_jtag_comm.c: avoid calling put_tty_driver on NULL 2011-03-23 19:46:39 -07:00
cyclades.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
isicom.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
moxa.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
moxa.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
mxser.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
mxser.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
n_gsm.c n_gsm: fix UIH control byte : P bit should be 0 2011-03-09 15:43:39 -08:00
n_hdlc.c drivers: remove extraneous includes of smp_lock.h 2011-03-02 00:02:40 +01:00
n_r3964.c drivers: remove extraneous includes of smp_lock.h 2011-03-02 00:02:40 +01:00
n_tty.c tty: fix endless work loop when the buffer fills up 2011-04-04 14:26:54 -07:00
nozomi.c nozomi: don't use flush_scheduled_work() 2011-02-25 11:56:10 -08:00
pty.c Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2011-03-16 17:21:00 -07:00
rocket.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
rocket.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
rocket_int.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclink.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclink_gt.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclinkmp.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
sysrq.c lib, arch: add filter argument to show_mem and fix private implementations 2011-03-24 17:49:37 -07:00
tty_audit.c tty_audit: fix tty_audit_add_data live lock on audit disabled 2011-03-07 12:04:50 -08:00
tty_buffer.c tty: fix endless work loop when the buffer fills up 2011-04-04 14:26:54 -07:00
tty_io.c Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2011-03-16 17:21:00 -07:00
tty_ioctl.c tty: add a helper for setting termios data from kernel side 2011-02-17 12:03:52 -08:00
tty_ldisc.c tty: stop using "delayed_work" in the tty layer 2011-03-22 16:17:32 -07:00
tty_mutex.c TTY: create drivers/tty and move the tty core files there 2010-11-05 08:10:33 -07:00
tty_port.c TTY: create drivers/tty and move the tty core files there 2010-11-05 08:10:33 -07:00