android_kernel_xiaomi_sm8350/drivers
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
..
accessibility
acpi acpi: Remove sysfs_create_link from video driver 2011-03-28 13:05:29 -07:00
amba
ata Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-03-30 07:50:45 -07:00
atm atm/solos-pci: Don't flap VCs when carrier state changes 2011-03-30 16:53:38 -07:00
auxdisplay
base
block drbd: fix up merge error 2011-03-28 07:42:58 -07:00
bluetooth
cdrom
char char/tpm: Fix unitialized usage of data buffer 2011-03-29 09:45:34 -07:00
clk
clocksource
connector connector: convert to synchronous netlink message processing 2011-03-30 17:14:33 -07:00
cpufreq
cpuidle
crypto
dca
dio
dma Merge branch 'irq-cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-03-27 20:58:56 -07:00
edac amd64_edac: Fix potential memleak 2011-03-29 18:19:06 +02:00
eisa
firewire
firmware
gpio gpio: ab8500: Mark broken 2011-03-29 14:50:42 +02:00
gpu
hid
hwmon hwmon: twl4030-madc-hwmon: add "platform:" prefix for platform modalias 2011-03-29 17:26:18 -07:00
hwspinlock
i2c
ide
idle
ieee802154
infiniband
input drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
isdn
leds
lguest
macintosh powerpc/pmac: Rename cpu_state in therm_pm72 to avoid collision 2011-04-01 15:37:27 +11:00
mca
md md: Fix integrity registration error when no devices are capable 2011-03-28 17:53:29 -07:00
media Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-04-04 08:37:45 -07:00
memstick memstick: make enable_dma less generic in r592 2011-03-28 16:24:29 -07:00
message
mfd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc 2011-03-29 12:09:30 -07:00
misc drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
mmc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc 2011-03-29 12:09:30 -07:00
mtd
net mlx4: Fixing bad size of event queue buffer 2011-03-31 02:52:18 -07:00
nfc
nubus
of
oprofile
parisc parisc: Convert irq namespace 2011-03-29 14:48:08 +02:00
parport
pci drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
pcmcia Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-03-30 07:50:45 -07:00
platform drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
pnp
power drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
pps
ps3
rapidio
regulator regulator: Add MODULE_DEVICE_TABLE to max8997 and max8998 2011-03-27 11:47:25 +01:00
rtc rtc-mrst: Fix section types 2011-04-04 08:21:07 -07:00
s390
sbus
scsi x86: Stop including <linux/delay.h> in two asm header files 2011-03-29 09:37:42 +02:00
sfi
sh sh: Fix irq cleanup fallout 2011-03-30 00:15:49 +02:00
sn
spi
ssb
staging Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-04-04 08:33:53 -07:00
target
tc
telephony
thermal
tty tty: fix endless work loop when the buffer fills up 2011-04-04 14:26:54 -07:00
uio
usb usb/serial: fix function args warnings, dropping *filp 2011-04-04 08:35:20 -07:00
uwb
vhost
video Merge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32 2011-04-04 08:33:21 -07:00
virtio
vlynq vlynq: Convert irq functions 2011-03-28 19:33:04 +02:00
w1 drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
watchdog watchdog: softdog.c: enhancement to optionally invoke panic instead of reboot on timer expiry 2011-03-29 11:56:22 +00:00
xen xen: Use new irq_move functions 2011-03-29 10:01:05 -04:00
zorro
Kconfig
Makefile