qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/3] qemu-char: Add poll timeouts for character backends
@ 2014-10-24  8:13 Heinz Graalfs
  2014-10-24  8:13 ` [Qemu-devel] [RFC 1/3] char: Trigger timeouts on poll() when frontend is unready Heinz Graalfs
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heinz Graalfs @ 2014-10-24  8:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, Heinz Graalfs, borntraeger

On s390 one can observe system hang situations wrt console input when
using 'dataplane=on'.

dataplane processing causes an inactive main thread and an active
dataplane thread.

When a character backend descriptor disappears from the main thread's
poll() descriptor array (when can_read() returns 0) it happens that it
will never reappear in the poll() array due to missing poll() interrupts.

The following patches fix observed hangs on s390 and provide a means
to avoid potential hangs in other backends/frontends.

The command line to reproduce the hang on s390:
qemu-system-s390x -machine s390-ccw-virtio,accel=kvm,usb=off,kernel_irqchip=on
 -m 1024 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -rtc base=utc
 -drive file=/dev/disk/by-path/ccw-0.0.e7ac,if=none,id=drive-virtio-disk0,
  format=raw,werror=report,rerror=report,cache=none,aio=native
 -device virtio-blk-ccw,ioeventfd=on,scsi=off,config-wce=off,devno=fe.0.0001,
  drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,x-data-plane=on
 -kernel /guest/vmlinux
 -append "root=/dev/vda1 console=ttyS0"
 -chardev stdio,id=sclpcon1,mux=off
 -device sclplmconsole,chardev=sclpcon1
 -nographic -nodefaults

Patch 1:
Adds timeout to poll() when a frontend returned -EAGAIN on 'can_read'.

Patch 2:
The SCLP line mode console now returns -EAGAIN on 'can_read' to fix a hang
after the backend descriptor disappeared forever from the poll() descriptor
array.

Patch 3:
The ASCII console now returns -EAGAIN on 'can_read' to avoid a potential hang.

Heinz Graalfs (3):
  char: Trigger timeouts on poll() when frontend is unready
  s390x: Fix hanging SCLP line mode console
  s390x: Avoid hanging SCLP ASCII console

 hw/char/sclpconsole-lm.c |  4 ++--
 hw/char/sclpconsole.c    |  7 ++++++-
 qemu-char.c              | 27 ++++++++++++++++++++++++++-
 3 files changed, 34 insertions(+), 4 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-24 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24  8:13 [Qemu-devel] [RFC 0/3] qemu-char: Add poll timeouts for character backends Heinz Graalfs
2014-10-24  8:13 ` [Qemu-devel] [RFC 1/3] char: Trigger timeouts on poll() when frontend is unready Heinz Graalfs
2014-10-24  8:13 ` [Qemu-devel] [RFC 2/3] s390x: Fix hanging SCLP line mode console Heinz Graalfs
2014-10-24  8:13 ` [Qemu-devel] [RFC 3/3] s390x: Avoid hanging SCLP ASCII console Heinz Graalfs
2014-10-24  9:15 ` [Qemu-devel] [RFC 0/3] qemu-char: Add poll timeouts for character backends Paolo Bonzini
2014-10-24 11:29   ` Heinz Graalfs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).