qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] event_notifier: move to top-level directory


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] event_notifier: move to top-level directory
Date: Tue, 27 Sep 2011 18:39:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 09/27/2011 06:05 PM, Anthony Liguori wrote:
Actually, for posix-aio, we can just switch to using g_idle_add().
g_idle_add() uses g_source_attach which is thread safe.  g_idle_add()
 gives you a thread safe mechanism to defer a piece of work to the
main loop which is really what we want here.

For that, a bottom half would also do (apart that I am not sure it is
async-safe with TCG).  In fact, that would make sense since all of
posix_aio_process_queue could become a bottom half.

But the problem to be solved here is waking up qemu_aio_wait, and
scheduling bottom halves currently wakes up only the vl.c main loop.

This can actually be made to work with sync I/O emulation too by
having another GMainLoop in the sync I/O loop although I thought I
recalled a patch series to remove that stuff.

... which stuff? :) Another GMainLoop in the sync I/O loop is problematic for two reasons: 1) the sync I/O loop does not relinquish the I/O thread mutex, which makes it very different from the outer loop; 2) a nested GMainLoop keeps polling all the file descriptors in the outer loop, which requires you to cope with reentrancy in those monitor commands that flush AIO.

Paolo



reply via email to

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