Re: [Qemu-devel] [PATCH for-2.9 5/5] coroutine: Explicitly specify AioContext when creating coroutine

2017-04-07 Thread Fam Zheng
On Thu, 04/06 18:20, Kevin Wolf wrote: > For example, another case where this happens is that block jobs follow > their nodes if the AioContext changes and even implement > .attached_aio_context callbacks when they need to drag additional nodes > into the new context. With your change, the job coro

Re: [Qemu-devel] [PATCH for-2.9 5/5] coroutine: Explicitly specify AioContext when creating coroutine

2017-04-06 Thread Kevin Wolf
Am 06.04.2017 um 16:25 hat Fam Zheng geschrieben: > Coroutine in block layer should always be waken up in bs->aio_context > rather than the "current" context where it is entered. They differ when > the main loop is doing QMP tasks. This whole mechanism is complex stuff that I haven't quite caught

Re: [Qemu-devel] [PATCH for-2.9 5/5] coroutine: Explicitly specify AioContext when creating coroutine

2017-04-06 Thread Eric Blake
On 04/06/2017 09:25 AM, Fam Zheng wrote: > Coroutine in block layer should always be waken up in bs->aio_context s/waken up/awakened/ > rather than the "current" context where it is entered. They differ when > the main loop is doing QMP tasks. > > Race conditions happen without this patch, becau

[Qemu-devel] [PATCH for-2.9 5/5] coroutine: Explicitly specify AioContext when creating coroutine

2017-04-06 Thread Fam Zheng
Coroutine in block layer should always be waken up in bs->aio_context rather than the "current" context where it is entered. They differ when the main loop is doing QMP tasks. Race conditions happen without this patch, because the wrong context is acquired in co_schedule_bh_cb, while the entered c