From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
To: qemu-block@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Ari Sundholm" <ari@tuxera.com>,
"Pavel Dovgalyuk" <pavel.dovgaluk@ispras.ru>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Stefan Weil" <sw@weilnetz.de>, "Fam Zheng" <fam@euphon.net>,
"Ronnie Sahlberg" <ronniesahlberg@gmail.com>,
"Peter Lieven" <pl@kamp.de>, "Eric Blake" <eblake@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alberto Garcia" <berto@igalia.com>,
"Ilya Dryomov" <idryomov@gmail.com>,
"Wen Congyang" <wencongyang2@huawei.com>,
"Xie Changlong" <xiechanglong.d@gmail.com>,
"Richard W.M. Jones" <rjones@redhat.com>,
"Jeff Cody" <codyprime@gmail.com>,
"Cleber Rosa" <crosa@redhat.com>,
qemu-devel@nongnu.org, integration@gluster.org
Subject: Re: [PATCH 00/15] Protect the block layer with a rwlock: part 3
Date: Mon, 21 Nov 2022 16:02:26 +0100 [thread overview]
Message-ID: <baec4d74-4c61-092a-f508-a6e7018762fe@redhat.com> (raw)
In-Reply-To: <20221116140730.3056048-1-eesposit@redhat.com>
Ok, as I expected simple changes in a previous based-on serie provoke a
cascade of changes that inevitably affect these patches too.
While I strongly suggest to have an initial look at these patches
because it gives an idea on what am I trying to accomplish, I would not
go looking at nitpicks and trivial errors that came up from the based-on
series (ie "just as in the previous serie, fix this").
The order of the series is:
1. Still more coroutine and various fixes in block layer
2. Protect the block layer with a rwlock: part 1
3. Protect the block layer with a rwlock: part 2
4. Protect the block layer with a rwlock: part 3
Thank you,
Emanuele
Am 16/11/2022 um 15:07 schrieb Emanuele Giuseppe Esposito:
> Please read "Protect the block layer with a rwlock: part 1" and
> "Protect the block layer with a rwlock: part 2" for an
> additional introduction and aim of this series.
>
> In this serie, we cover the remaining BlockDriver IO callbacks that were not
> running in coroutine, therefore not using the graph rdlock.
> Therefore convert them to coroutines, using either g_c_w or a new
> variant introduced in this serie (see below).
>
> We need to convert these callbacks into coroutine because non-coroutine code
> is tied to the main thread, even though it will still delegate I/O accesses to
> the iothread (via the bdrv_coroutine_enter call in generated_co_wrappers).
> Making callbacks run in coroutines provides more flexibility, because they run
> entirely in iothreads and can use CoMutexes for mutual exclusion.
>
> Here we introduce generated_co_wrapper_simple, a simplification of g_c_w that
> only considers the case where the caller is not in a coroutine.
> This simplifies and clarifies a lot when the caller is a coroutine or not, and
> in the future will hopefully replace g_c_w.
>
> While we are at it, try to directly call the _co_ counterpart of a g_c_w when
> we know already that the function always run in a coroutine.
>
> Based-on: <20221116135331.3052923-1-eesposit@redhat.com>
>
> Thank you,
> Emanuele
>
> Emanuele Giuseppe Esposito (15):
> block/qed: add missing graph rdlock in qed_need_check_timer_entry
> block: rename refresh_total_sectors in bdrv_refresh_total_sectors
> block-backend: use bdrv_getlength instead of blk_getlength
> block: convert bdrv_refresh_total_sectors in generated_co_wrapper
> block: use bdrv_co_refresh_total_sectors when possible
> block: convert bdrv_get_allocated_file_size in
> generated_co_wrapper_simple
> block: convert bdrv_get_info in generated_co_wrapper
> block: convert bdrv_is_inserted in generated_co_wrapper_simple
> block-coroutine-wrapper: support void functions
> block: convert bdrv_eject in generated_co_wrapper_simple
> block: convert bdrv_lock_medium in generated_co_wrapper_simple
> block: convert bdrv_debug_event in generated_co_wrapper
> block: convert bdrv_io_plug in generated_co_wrapper_simple
> block: convert bdrv_io_unplug in generated_co_wrapper_simple
> block: rename newly converted BlockDriver IO coroutine functions
>
> block.c | 93 +++++++++++++++++++-----------
> block/blkdebug.c | 4 +-
> block/blkio.c | 6 +-
> block/blklogwrites.c | 2 +-
> block/blkreplay.c | 2 +-
> block/blkverify.c | 2 +-
> block/block-backend.c | 43 ++++++++------
> block/commit.c | 4 +-
> block/copy-on-read.c | 12 ++--
> block/crypto.c | 6 +-
> block/curl.c | 8 +--
> block/file-posix.c | 48 +++++++--------
> block/file-win32.c | 8 +--
> block/filter-compress.c | 10 ++--
> block/gluster.c | 16 ++---
> block/io.c | 78 +++++++++++++------------
> block/iscsi.c | 8 +--
> block/meson.build | 1 +
> block/mirror.c | 17 ++++--
> block/nbd.c | 6 +-
> block/nfs.c | 2 +-
> block/null.c | 8 +--
> block/nvme.c | 6 +-
> block/preallocate.c | 2 +-
> block/qcow.c | 2 +-
> block/qcow2-refcount.c | 2 +-
> block/qcow2.c | 6 +-
> block/qed.c | 7 ++-
> block/quorum.c | 2 +-
> block/raw-format.c | 14 ++---
> block/rbd.c | 4 +-
> block/replication.c | 2 +-
> block/ssh.c | 2 +-
> block/stream.c | 4 +-
> block/throttle.c | 2 +-
> block/vdi.c | 2 +-
> block/vhdx.c | 2 +-
> block/vmdk.c | 4 +-
> block/vpc.c | 2 +-
> blockdev.c | 8 ++-
> hw/scsi/scsi-disk.c | 5 ++
> include/block/block-io.h | 40 +++++++++----
> include/block/block_int-common.h | 37 +++++++-----
> include/block/block_int-io.h | 5 +-
> include/sysemu/block-backend-io.h | 32 +++++++---
> scripts/block-coroutine-wrapper.py | 19 ++++--
> tests/unit/test-block-iothread.c | 7 +++
> 47 files changed, 364 insertions(+), 238 deletions(-)
>
prev parent reply other threads:[~2022-11-21 15:04 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 14:07 [PATCH 00/15] Protect the block layer with a rwlock: part 3 Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 01/15] block/qed: add missing graph rdlock in qed_need_check_timer_entry Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 02/15] block: rename refresh_total_sectors in bdrv_refresh_total_sectors Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 03/15] block-backend: use bdrv_getlength instead of blk_getlength Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 04/15] block: convert bdrv_refresh_total_sectors in generated_co_wrapper Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 05/15] block: use bdrv_co_refresh_total_sectors when possible Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 06/15] block: convert bdrv_get_allocated_file_size in generated_co_wrapper_simple Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 07/15] block: convert bdrv_get_info in generated_co_wrapper Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 08/15] block: convert bdrv_is_inserted in generated_co_wrapper_simple Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 09/15] block-coroutine-wrapper: support void functions Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 10/15] block: convert bdrv_eject in generated_co_wrapper_simple Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 11/15] block: convert bdrv_lock_medium " Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 12/15] block: convert bdrv_debug_event in generated_co_wrapper Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 13/15] block: convert bdrv_io_plug in generated_co_wrapper_simple Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 14/15] block: convert bdrv_io_unplug " Emanuele Giuseppe Esposito
2022-11-16 14:07 ` [PATCH 15/15] block: rename newly converted BlockDriver IO coroutine functions Emanuele Giuseppe Esposito
2022-11-18 10:57 ` [PATCH 00/15] Protect the block layer with a rwlock: part 3 Paolo Bonzini
2022-11-18 15:01 ` Emanuele Giuseppe Esposito
2022-11-18 15:13 ` Paolo Bonzini
2022-11-23 11:45 ` Emanuele Giuseppe Esposito
2022-11-23 13:45 ` Kevin Wolf
2022-11-23 17:04 ` Paolo Bonzini
2022-11-23 18:12 ` Kevin Wolf
2022-11-21 15:02 ` Emanuele Giuseppe Esposito [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=baec4d74-4c61-092a-f508-a6e7018762fe@redhat.com \
--to=eesposit@redhat.com \
--cc=ari@tuxera.com \
--cc=berto@igalia.com \
--cc=codyprime@gmail.com \
--cc=crosa@redhat.com \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=idryomov@gmail.com \
--cc=integration@gluster.org \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=ronniesahlberg@gmail.com \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
--cc=vsementsov@yandex-team.ru \
--cc=wencongyang2@huawei.com \
--cc=xiechanglong.d@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).