diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-10-20 13:45:43 +1030 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-20 13:18:04 -0700 |
commit | 531295e63be8c2b8b909d7400739e8b8df60d61f (patch) | |
tree | 1ae5e6429e3fb52104220e543534049a6832ba1a /arch/mips/kernel/gpio_txx9.c | |
parent | 30c278192f9ab06125fb042f6e46763e0fd7140a (diff) |
virtio: console: Don't block entire guest if host doesn't read data
If the host is slow in reading data or doesn't read data at all,
blocking write calls not only blocked the program that called write()
but the entire guest itself.
To overcome this, let's not block till the host signals it has given
back the virtio ring element we passed it. Instead, send the buffer to
the host and return to userspace. This operation then becomes similar
to how non-blocking writes work, so let's use the existing code for this
path as well.
This code change also ensures blocking write calls do get blocked if
there's not enough room in the virtio ring as well as they don't return
-EAGAIN to userspace.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
CC: stable@kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/kernel/gpio_txx9.c')
0 files changed, 0 insertions, 0 deletions