[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end |
Date: |
Thu, 30 Nov 2017 17:04:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 30/11/2017 16:10, Kevin Wolf wrote:
>> Yes, I agree, but that (using CoMutex around graph change) requires
>> everything, especially the defer_to_main_loop_bh, runs in a coroutine
>> context, which is exactly what I mean by "introducing 'ubiquitous
>> coroutines'", because currently we don't have them.
> Is it hard to do, though? Instead of using a BH to switch to the main
> loop and outside of coroutine context, you could use aio_co_schedule()
> and yield, which would leave you in the main loop, but still in
> coroutine context.
Not that I think of, but just aio_co_schedule wouldn't work, because
"the coroutine must have yielded unless ctx is the context in which the
coroutine is running (i.e. the value of qemu_get_current_aio_context()
from the coroutine itself)".
So you'd have to use a bottom half that calls aio_co_schedule. But that
would work.
Paolo
> Would this have any bad side effects I'm not aware of?
- [Qemu-block] [PATCH RFC 5/9] qed: Implement AioContext drain ops, (continued)
- [Qemu-block] [PATCH RFC 5/9] qed: Implement AioContext drain ops, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 7/9] block: Switch to use AIO drained begin/end API, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 8/9] block: Drop old drained_{begin, end} callbacks, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 9/9] blockjob: Drop unused functions, Fam Zheng, 2017/11/29
- Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end, Kevin Wolf, 2017/11/29