Bug 673983 - virtio_console driver never returns from selecting for write when the queue is full [rhel-5.6.z]
Summary: virtio_console driver never returns from selecting for write when the queue i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.7
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Jiri Pirko
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On: 673459
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-31 09:14 UTC by RHEL Program Management
Modified: 2015-05-05 01:22 UTC (History)
8 users (show)

Fixed In Version: kernel-2.6.18-238.4.1.el5
Doc Type: Bug Fix
Doc Text:
Using a virtio serial port from an application, filling it until the write command returns -EAGAIN and then executing a select command for the write command caused the select command to not return any values, when using the virtio serial port in a non-blocking mode. When used in a blocking mode, the write command waited until the host indicated it used up the buffers. This was due to the fact that the poll operation waited for the port->waitqueue pointer, however, nothing woke the waitqueue when there was room again in the queue. With this update, the queue is woken via host notifications so that buffers consumed by the host can be reclaimed, the queue freed, and the application write operations may proceed again.
Clone Of:
Environment:
Last Closed: 2011-03-01 20:31:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0303 0 normal SHIPPED_LIVE Moderate: kernel security and bug fix update 2011-03-01 20:29:26 UTC

Description RHEL Program Management 2011-01-31 09:14:41 UTC
This bug has been copied from bug #673459 and has been proposed
to be backported to 5.6 z-stream (EUS).

Comment 2 Jiri Pirko 2011-02-03 09:21:03 UTC
in kernel-2.6.18-238.4.1.el5

linux-2.6-char-virtio-wake-console-outvq-on-host-notifications.patch

Comment 4 Mike Cao 2011-02-16 08:26:14 UTC
Verified on qemu-kvm-0.12.1.2-2.144.el6.
guest kernel : kernel-2.6.18-238.4.1.el5

steps:
1.start VM with virtio-serial-port w/o -M parameter.
2.open the socket file on the host and not read it
eg:#cat open-socket 
#!/usr/bin/python
import os
import sys
import socket
import time

#fd = os.open(sys.argv[1], os.O_RDONLY)

s = socket.socket(socket.AF_UNIX)
s.connect(sys.argv[1])

while 1:
        # do nothing
        time.sleep(1)

#python open-socket /tmp/vport0
3.transfer a file whose size > 2G via virtio-serial
eg :#cat /tt > /dev/vport0p1

Actual Results:
qemu-kvm process does not freeze.

Based on above ,this issue has been fixed.
Change status to VERIFIED.

Comment 5 errata-xmlrpc 2011-03-01 20:31:03 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0303.html

Comment 6 Martin Prpič 2011-07-13 20:22:10 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Using a virtio serial port from an application, filling it until the write command returns -EAGAIN and then executing a select command for the write command caused the select command to not return any values, when using the virtio serial port in a non-blocking mode. When used in a blocking mode, the write command waited until the host indicated it used up the buffers. This was due to the fact that the poll operation waited for the port->waitqueue pointer, however, nothing woke the waitqueue when there was room again in the queue. With this update, the queue is woken via host notifications so that buffers consumed by the host can be reclaimed, the queue freed, and the application write operations may proceed again.


Note You need to log in before you can comment on or make changes to this bug.