qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 0/5] chardev, virtio-console: flow control, erro


From: Amit Shah
Subject: [Qemu-devel] Re: [PATCH 0/5] chardev, virtio-console: flow control, error handling
Date: Tue, 6 Apr 2010 13:22:42 +0530
User-agent: Mutt/1.5.19 (2009-01-05)

On (Tue) Apr 06 2010 [09:36:17], Gerd Hoffmann wrote:
>   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).

True. I'm interesting in non-blocking files for now.

>> 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.

So you mean just return -EAGAIN in case write returns with -EAGAIN?

Yeah, makes sense.

>> - 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.

                Amit




reply via email to

[Prev in Thread] Current Thread [Next in Thread]