qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule i


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx
Date: Wed, 12 May 2021 10:15:28 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

12.05.2021 09:56, Paolo Bonzini wrote:
On 16/04/21 10:08, Vladimir Sementsov-Ogievskiy wrote:
With the following patch we want to call wake coroutine from thread.
And it doesn't work with aio_co_wake:
Assume we have no iothreads.
Assume we have a coroutine A, which waits in the yield point for
external aio_co_wake(), and no progress can be done until it happen.
Main thread is in blocking aio_poll() (for example, in blk_read()).

Now, in a separate thread we do aio_co_wake(). It calls  aio_co_enter(),
which goes through last "else" branch and do aio_context_acquire(ctx).

I don't understand.  Why doesn't aio_co_enter go through the ctx != 
qemu_get_current_aio_context() branch and just do aio_co_schedule?  That was at 
least the idea behind aio_co_wake and aio_co_enter.


Because ctx is exactly qemu_get_current_aio_context(), as we are not in 
iothread but in nbd connection thread. So, qemu_get_current_aio_context() 
returns qemu_aio_context.


--
Best regards,
Vladimir



reply via email to

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