qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 0/5] nbd: Adapt for dataplane


From: Max Reitz
Subject: Re: [Qemu-devel] [RFC 0/5] nbd: Adapt for dataplane
Date: Sat, 31 May 2014 22:24:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 31.05.2014 20:43, Max Reitz wrote:
[snip]

However, if bs_aio_detach() is called from a different thread than the
old AioContext is running in, we may still have coroutines running for
which we should wait before returning from bs_aio_detach().

After re-reading Stefan's RFC and the AIO locking code, would it suffice to call aio_context_acquire() and aio_context_release() on the old AioContext at the end of bs_aio_detach() to ensure all coroutines are settled? If not, I guess I have to wait until the coroutine variables are set to NULL (which indicates they have completely finished execution; however, this is not actually necessary and might lead to an infinite loop if the block driver keeps yielding due to some condition related to the AioContext switch), or I really have to switch the existing coroutines to the new AioContext while they are running. Doing this from the outside will probably be even messier than it would already be from the inside, so I sure hope to be able to avoid this…

Max



reply via email to

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