[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 14/16] job.c: use job_get_aio_context()
From: |
Emanuele Giuseppe Esposito |
Subject: |
Re: [PATCH v3 14/16] job.c: use job_get_aio_context() |
Date: |
Wed, 26 Jan 2022 16:58:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 24/01/2022 15:22, Paolo Bonzini wrote:
> On 1/21/22 16:18, Emanuele Giuseppe Esposito wrote:
>>>>
>>>
>>> Better to use aio_co_schedule here, too, and move it under the
>>> previous WITH_JOB_LOCK_GUARD.
>>
>> Unfortunately this does not work straightforward: aio_co_enter invokes
>> aio_co_schedule only if the context is different from the main loop,
>> otherwise it can directly enter the coroutine with
>> qemu_aio_coroutine_enter. So always replacing it with aio_co_schedule
>> breaks the unit tests assumptions, as they expect that when control is
>> returned the job has already executed.
>>
>> A possible solution is to aio_poll() on the condition we want to
>> assert, waiting for the bh to be scheduled. But I don't know if this
>> is then useful to test something.
>
> I think you sorted that out, based on IRC conversation?
>
Yes.
Thank you,
Emanuele
- [PATCH v3 11/16] jobs: document all static functions and add _locked() suffix, (continued)
[PATCH v3 13/16] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2022/01/05
[PATCH v3 10/16] jobs: protect jobs with job_lock/unlock, Emanuele Giuseppe Esposito, 2022/01/05
[PATCH v3 16/16] block_job_query: remove atomic read, Emanuele Giuseppe Esposito, 2022/01/05
[PATCH v3 09/16] jobs: remove aiocontext locks since the functions are under BQL, Emanuele Giuseppe Esposito, 2022/01/05
[PATCH v3 12/16] jobs: use job locks and helpers also in the unit tests, Emanuele Giuseppe Esposito, 2022/01/05
[PATCH v3 04/16] job.h: define unlocked functions, Emanuele Giuseppe Esposito, 2022/01/05