Nicholas Piggin
68b2fc714f
tty: hvc: hvc_poll() fix read loop batching
...
Commit ec97eaad13 ("tty: hvc: hvc_poll() break hv read loop")
removes get_chars batching entirely, which slows down large console
operations like paste -- virtio console "feels worse than a 9600 baud
serial line," reports Matteo.
This adds back batching in a more latency friendly way. If the caller
can sleep then we try to fill the entire flip buffer, releasing the
lock and scheduling between each iteration. If it can not sleep, then
batches are limited to 128 bytes. Matteo confirms this fixes the
performance problem.
Latency testing the powerpc OPAL console with OpenBMC UART with a
large paste shows about 0.25ms latency, which seems reasonable. 10ms
latencies were typical for this case before the latency breaking work,
so we still see most of the benefit.
kopald-1204 0d.h. 5us : hvc_poll <-hvc_handle_interrupt
kopald-1204 0d.h. 5us : __hvc_poll <-hvc_handle_interrupt
kopald-1204 0d.h. 5us : _raw_spin_lock_irqsave <-__hvc_poll
kopald-1204 0d.h. 5us : tty_port_tty_get <-__hvc_poll
kopald-1204 0d.h. 6us : _raw_spin_lock_irqsave <-tty_port_tty_get
kopald-1204 0d.h. 6us : _raw_spin_unlock_irqrestore <-tty_port_tty_get
kopald-1204 0d.h. 6us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 7us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 7us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 36us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 36us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 36us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 65us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 65us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 66us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 94us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 95us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 95us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 124us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 124us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 125us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 154us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 154us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 154us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 183us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 184us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 184us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 213us : tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 213us : __tty_buffer_request_room <-__hvc_poll
kopald-1204 0d.h. 213us+: opal_get_chars <-__hvc_poll
kopald-1204 0d.h. 242us : _raw_spin_unlock_irqrestore <-__hvc_poll
kopald-1204 0d.h. 242us : tty_flip_buffer_push <-__hvc_poll
kopald-1204 0d.h. 243us : queue_work_on <-tty_flip_buffer_push
kopald-1204 0d.h. 243us : tty_kref_put <-__hvc_poll
kopald-1204 0d.h. 243us : hvc_kick <-hvc_handle_interrupt
kopald-1204 0d.h. 243us : wake_up_process <-hvc_kick
kopald-1204 0d.h. 244us : try_to_wake_up <-hvc_kick
kopald-1204 0d.h. 244us : _raw_spin_lock_irqsave <-try_to_wake_up
kopald-1204 0d.h. 244us : _raw_spin_unlock_irqrestore <-try_to_wake_up
Reported-by: Matteo Croce <mcroce@redhat.com>
Tested-by: Matteo Croce <mcroce@redhat.com>
Tested-by: Jason Gunthorpe <jgg@mellanox.com>
Tested-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:04:31 +02:00
arch
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-09-09 07:05:15 -07:00
block
block: bfq: swap puts in bfqg_and_blkg_put
2018-09-06 11:32:58 -06:00
certs
export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
2018-08-22 23:21:44 +09:00
crypto
DMAengine updates for v4.19-rc1
2018-08-18 15:55:59 -07:00
Documentation
Fix things so the choice of whether or not to trust RDRAND to
2018-09-09 05:54:05 -07:00
drivers
tty: hvc: hvc_poll() fix read loop batching
2018-09-10 18:04:31 +02:00
firmware
fs
afs: Fix cell specification to permit an empty address list
2018-09-07 16:39:44 -07:00
include
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-09-09 06:55:27 -07:00
init
Kbuild updates for v4.19 (2nd)
2018-08-25 13:40:38 -07:00
ipc
ipc/shm: properly return EIDRM in shm_lock()
2018-09-04 16:45:02 -07:00
kernel
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-09-09 06:55:27 -07:00
lib
lib/Kconfig.debug: fix three typos in help text
2018-09-04 16:45:02 -07:00
LICENSES
mm
for-linus-20180906
2018-09-06 14:01:15 -07:00
net
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2018-09-04 12:45:11 -07:00
samples
samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM
2018-08-16 21:55:32 +02:00
scripts
Kbuild fixes for v4.19
2018-09-09 05:42:11 -07:00
security
- Fix for bad debug check when converting secids to secctx
2018-09-06 09:42:14 -07:00
sound
ALSA: hda: Fix several mismatch for register mask and value
2018-09-03 23:47:40 +02:00
tools
KVM fixes for 4.19-rc3
2018-09-08 15:52:45 -07:00
usr
initramfs: move gen_initramfs_list.sh from scripts/ to usr/
2018-08-22 23:21:44 +09:00
virt
KVM: Remove obsolete kvm_unmap_hva notifier backend
2018-09-07 15:06:02 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
libnvdimm-for-4.19_misc
2018-08-25 18:13:10 -07:00
COPYING
CREDITS
9p: remove Ron Minnich from MAINTAINERS
2018-08-17 16:20:26 -07:00
Kbuild
Kconfig
kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
2018-08-02 08:06:55 +09:00
MAINTAINERS
i2c: xiic: Record xilinx i2c with Zynq fragment
2018-09-07 13:04:45 +02:00
Makefile
Linux 4.19-rc3
2018-09-09 17:26:43 -07:00
README