[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need exp
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need explicit aio_poll() |
Date: |
Wed, 6 Mar 2019 13:59:38 +0100 |
On Wed, Mar 6, 2019 at 1:05 PM Peter Xu <address@hidden> wrote:
>
> After consulting Paolo I know why we'd better keep the explicit
> aio_poll() in iothread_run(). Document it directly into the code so
> that future readers will know the answer from day one.
>
> Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> iothread.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/iothread.c b/iothread.c
> index 045825a348..14e9f3779e 100644
> --- a/iothread.c
> +++ b/iothread.c
> @@ -64,6 +64,15 @@ static void *iothread_run(void *opaque)
> qemu_sem_post(&iothread->init_done_sem);
>
> while (iothread->running) {
> + /*
> + * Note: from functional-wise the g_main_loop_run() below can
> + * already cover the aio_poll() events, but we can't run the
> + * main loop unconditionally because explicit aio_poll() here
> + * is faster than g_main_loop_run() when we do not need the
> + * gcontext at all (e.g., pure block layer iothreads). In
> + * other words, when we want to run the gcontext with the
> + * iothread we need to pay some performance for functionality.
> + */
> aio_poll(iothread->ctx, true);
>
> /*
> --
> 2.17.1
>
>
--
Marc-André Lureau
- [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 1/5] iothread: replace init_done_cond with a semaphore, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 2/5] iothread: create the gcontext unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 3/5] iothread: create main loop unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need explicit aio_poll(), Peter Xu, 2019/03/06
- Re: [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need explicit aio_poll(),
Marc-André Lureau <=
- Re: [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally, Stefan Hajnoczi, 2019/03/08