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_sch
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,
othe
On 21/01/2022 13:33, Emanuele Giuseppe Esposito wrote:
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/blockjob.c b/blockjob.c
index cf1f49f6c2..468ba735c5 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -155,14 +155,16 @@ static void child_job_set_aio_ctx(BdrvChild *c,
AioContext *ctx,
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/job.c b/job.c
index f16a4ef542..8a5b710d9b 100644
--- a/job.c
+++ b/job.c
@@ -566,7 +566,7 @@ void job_enter_cond_locked(Job *job, bool(*fn)(Job
*job))
job->busy = true;
real_job_unlock();
job_unlock();
- aio_co_en
On 19/01/2022 11:31, Paolo Bonzini wrote:
diff --git a/blockjob.c b/blockjob.c
index cf1f49f6c2..468ba735c5 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -155,14 +155,16 @@ static void child_job_set_aio_ctx(BdrvChild *c,
AioContext *ctx,
bdrv_set_aio_context_ignore(sibling->bs, ctx,
Getters such as job_get_aio_context are often wrong because the
AioContext can change immediately after returning.
So, I wonder if job.aio_context should be protected with a kind of "fake
rwlock": read under BQL or job_lock, write under BQL+job_lock. For this
to work, you can add an assert
If the job->aio_context is accessed under job_mutex,
leave as it is. Otherwise use job_get_aio_context().
Signed-off-by: Emanuele Giuseppe Esposito
---
block/commit.c | 4 ++--
block/mirror.c | 2 +-
block/replication.c | 2 +-
blockjob.c