qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontex


From: Paolo Bonzini
Subject: Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks
Date: Tue, 27 Sep 2022 23:12:46 +0200



Il lun 26 set 2022, 14:21 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> ha scritto:
On 9/18/22 20:12, Emanuele Giuseppe Esposito wrote:
>>> --- a/qemu-img.c
>>> +++ b/qemu-img.c
>>> @@ -911,7 +911,6 @@ static void run_block_job(BlockJob *job, Error
>>> **errp)
>>>        AioContext *aio_context = block_job_get_aio_context(job);
>>>        int ret = 0;
>>>    -    aio_context_acquire(aio_context);
>>>        job_lock();
>>>        job_ref_locked(&job->job);
>>>        do {
>> aio_poll() call here, doesn't require aio_context to be acquired?
> On the contrary I think, if you see in AIO_WAIT_WHILE we explicitly
> release it because we don't want to allow something else to run with the
> aiocontext acquired.
>

Still, in AIO_WAIT_WHILE() we release ctx_, but do aio_poll(qemu_get_aio_context(), true), so we poll in other context.

But here in qemu-img.c we drop aiocontext lock exactly for aio_context, which is an argument of aio_poll()..

It's the same, the acquire/release is done again in file descriptor callback or bottom halves (typically via aio_co_wake).

Paolo


--
Best regards,
Vladimir


reply via email to

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