From: Gerd Hoffmann <kraxel@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu list <qemu-devel@nongnu.org>, Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] Re: [PATCH 0/5] chardev, virtio-console: flow control, error handling
Date: Tue, 06 Apr 2010 09:36:17 +0200 [thread overview]
Message-ID: <4BBAE471.40308@redhat.com> (raw)
In-Reply-To: <1270471538-31275-1-git-send-email-amit.shah@redhat.com>
Hi,
> In case of EAGAIN, the unix_write() function just kept spinning while
> attempting to write to the chardev till it succeeded. This resulted in
> a stuck VM in case a chardev had opened connection but wasn't reading
> anything from qemu.
It spins only for non-blocking file handles. In blocking mode the write
syscall just goes sleep until it can write out data (or gets a signal).
> There are two fixes for that case:
> - Poll for POLLOUT instead of directly attempting write(), which helps
> relax the CPU (and we become greener).
No need to do that, see above. Having a poll() call in unix_write() is
wrong IMHO.
> - If the file that we're writing to is nonblocking, return -EAGAIN to
> the caller of qemu_chr_write() so that appropriate actions can be
> taken higher up in the stack.
Good.
cheers,
Gerd
next prev parent reply other threads:[~2010-04-06 7:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 12:45 [Qemu-devel] [PATCH 0/5] chardev, virtio-console: flow control, error handling Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 2/5] char: unix write: Add some sleep to ease off spinning in a tight loop Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 3/5] char: unix: For files that are nonblocking, report -EAGAIN to calling functions Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 4/5] virtio-console: Factor out common init between console and generic ports Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 5/5] virtio-console: Throttle virtio-serial-bus if we can't consume any more guest data Amit Shah
2010-04-06 7:45 ` [Qemu-devel] " Gerd Hoffmann
2010-04-05 16:33 ` [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes Paul Brook
2010-04-06 3:24 ` Amit Shah
2010-04-06 9:34 ` Paul Brook
2010-04-06 9:58 ` Amit Shah
2010-04-06 10:21 ` Gerd Hoffmann
2010-04-06 11:05 ` Amit Shah
2010-04-06 11:16 ` Gerd Hoffmann
2010-04-06 13:30 ` Jamie Lokier
2010-04-06 7:40 ` [Qemu-devel] " Gerd Hoffmann
2010-04-06 7:54 ` Amit Shah
2010-04-06 7:36 ` Gerd Hoffmann [this message]
2010-04-06 7:52 ` [Qemu-devel] Re: [PATCH 0/5] chardev, virtio-console: flow control, error handling Amit Shah
2010-04-06 8:17 ` Gerd Hoffmann
2010-04-06 8:28 ` Amit Shah
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=4BBAE471.40308@redhat.com \
--to=kraxel@redhat.com \
--cc=amit.shah@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.