[Qemu-devel] [PATCH v2 0/3] do not use aio_context_acquire/release in AIO-based drivers

Paolo Bonzini posted 3 patches 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170222180725.28611-1-pbonzini@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
block/curl.c  | 24 ++++++++++-------
block/iscsi.c | 83 +++++++++++++++++++++++++++++++++++++++++++++--------------
block/nfs.c   | 23 ++++++++++++++---
3 files changed, 98 insertions(+), 32 deletions(-)
[Qemu-devel] [PATCH v2 0/3] do not use aio_context_acquire/release in AIO-based drivers
Posted by Paolo Bonzini 7 years, 1 month ago
aio_context_acquire/release are only going away as soon as the block layer
becomes thread-safe, but we can already move away to other finer-grained
mutex whenever possible.

These three drivers don't use coroutines, hence a QemuMutex is a fine
primitive to use for protecting any per-BDS data in the libraries
they use.  The QemuMutex must protect any fd handlers or bottom halves,
and also the BlockDriver callbacks which were implicitly being called
under aio_context_acquire.

Paolo

v1->v2: missing unlock in error paths (patch 2, Stefan)

Paolo Bonzini (3):
  curl: do not use aio_context_acquire/release
  nfs: do not use aio_context_acquire/release
  iscsi: do not use aio_context_acquire/release

 block/curl.c  | 24 ++++++++++-------
 block/iscsi.c | 83 +++++++++++++++++++++++++++++++++++++++++++++--------------
 block/nfs.c   | 23 ++++++++++++++---
 3 files changed, 98 insertions(+), 32 deletions(-)

-- 
2.9.3


Re: [Qemu-devel] [PATCH v2 0/3] do not use aio_context_acquire/release in AIO-based drivers
Posted by Stefan Hajnoczi 7 years, 1 month ago
On Wed, Feb 22, 2017 at 07:07:22PM +0100, Paolo Bonzini wrote:
> aio_context_acquire/release are only going away as soon as the block layer
> becomes thread-safe, but we can already move away to other finer-grained
> mutex whenever possible.
> 
> These three drivers don't use coroutines, hence a QemuMutex is a fine
> primitive to use for protecting any per-BDS data in the libraries
> they use.  The QemuMutex must protect any fd handlers or bottom halves,
> and also the BlockDriver callbacks which were implicitly being called
> under aio_context_acquire.
> 
> Paolo
> 
> v1->v2: missing unlock in error paths (patch 2, Stefan)
> 
> Paolo Bonzini (3):
>   curl: do not use aio_context_acquire/release
>   nfs: do not use aio_context_acquire/release
>   iscsi: do not use aio_context_acquire/release
> 
>  block/curl.c  | 24 ++++++++++-------
>  block/iscsi.c | 83 +++++++++++++++++++++++++++++++++++++++++++++--------------
>  block/nfs.c   | 23 ++++++++++++++---
>  3 files changed, 98 insertions(+), 32 deletions(-)
> 
> -- 
> 2.9.3
> 

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan