qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] rbd: switch from pipe to QEMUBH completion noti


From: Josh Durgin
Subject: Re: [Qemu-devel] [PATCH] rbd: switch from pipe to QEMUBH completion notification
Date: Fri, 27 Dec 2013 17:07:57 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 12/05/2013 07:38 AM, Stefan Hajnoczi wrote:
rbd callbacks are called from non-QEMU threads.  Up until now a pipe was
used to signal completion back to the QEMU iothread.

The pipe writer code handles EAGAIN using select(2).  The select(2) API
is not scalable since fd_set size is static.  FD_SET() can write beyond
the end of fd_set if the file descriptor number is too high.  (QEMU's
main loop uses poll(2) to avoid this issue with select(2).)

Since the pipe itself is quite clumsy to use and QEMUBH is now
thread-safe, just schedule a BH from the rbd callback function.  This
way we can simplify I/O completion in addition to eliminating the
potential FD_SET() crash when file descriptor numbers become too high.

Crash scenario: QEMU already has 1024 file descriptors open.  Hotplug an
rbd drive and get the pipe writer to take the select(2) code path.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
Josh: This patch has not been tested.  I have just compiled it.

Sorry for the delay. This is a great simplification, and it passed my
tests. Thanks!

Reviewed- and Tested-by: Josh Durgin <address@hidden>



reply via email to

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