qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v8 17/20] job.c: enable job lock/unlock and remove Aiocontext


From: Stefan Hajnoczi
Subject: Re: [PATCH v8 17/20] job.c: enable job lock/unlock and remove Aiocontext locks
Date: Tue, 5 Jul 2022 14:07:59 +0100

On Wed, Jun 29, 2022 at 10:15:35AM -0400, Emanuele Giuseppe Esposito wrote:
> Change the job_{lock/unlock} and macros to use job_mutex.
> 
> Now that they are not nop anymore, remove the aiocontext
> to avoid deadlocks.
> 
> Therefore:
> - when possible, remove completely the aiocontext lock/unlock pair
> - if it is used by some other function too, reduce the locking
> section as much as possible, leaving the job API outside.
> 
> There is only one JobDriver callback, ->free() that assumes that
> the aiocontext lock is held (because it calls bdrv_unref), so for
> now keep that under aiocontext lock.

This discussion shouldn't hold up the patch series, it's a separate
issue:

Why does bdrv_unref() need the AioContext lock? The reference count
itself is protected by the BQL (bdrv_ref() is GS too). I/O requests
should be using fine-grained locks now, so I'm not sure if we still need
to hold the AioContext lock to drain them?

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Attachment: signature.asc
Description: PGP signature


reply via email to

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