qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v4 16/19] job: detect change of aiocontext within job corouti


From: Emanuele Giuseppe Esposito
Subject: Re: [PATCH v4 16/19] job: detect change of aiocontext within job coroutine
Date: Mon, 31 Jan 2022 11:03:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

> As a small improvement, we don't need aio_co_enter() in job_start(),
> we can simplify it with qemu_coroutine_enter(). If the aio_context
> where it is running is wrong, job_do_yield_locked() will automatically
> reschedule the coroutine where it belongs, once the first
> job_pause_point is triggered in job_co_entry.
> 

> @@ -1145,7 +1161,7 @@ void job_start(Job *job)
>          job->paused = false;
>          job_state_transition_locked(job, JOB_STATUS_RUNNING);
>      }
> -    aio_co_enter(job->aio_context, job->co);
> +    qemu_coroutine_enter(job->co);

This is actually wrong. If the job is not under drain, job_pause_point
in job_co_enter is not going to yield() job->co, so it won't change the
aiocontext automatically, running part if not all of job->driver->run()
in the wrong AioContext.

I will drop it in v5.

Emanuele




reply via email to

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