All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Hanna Czenczek <hreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard W . M . Jones" <rjones@redhat.com>,
	"Ilya Dryomov" <idryomov@gmail.com>,
	"Peter Lieven" <pl@dlhnet.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Fam Zheng" <fam@euphon.net>,
	"Ronnie Sahlberg" <ronniesahlberg@gmail.com>
Subject: Re: [PATCH v2 00/19] block: Some multi-threading fixes
Date: Mon, 17 Nov 2025 14:11:29 -0500	[thread overview]
Message-ID: <20251117191129.GA91711@fedora> (raw)
In-Reply-To: <20251110154854.151484-1-hreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4769 bytes --]

On Mon, Nov 10, 2025 at 04:48:35PM +0100, Hanna Czenczek wrote:
> Hi,
> 
> See the v1 cover letter for a general overview:
> 
> https://lists.nongnu.org/archive/html/qemu-block/2025-10/msg00501.html
> 
> Changes in v2:
> - Kept `.ret = EINPGORESS`-style initializations where they already had
>   been (curl, nvme)
> - Dropped trivial BH waking code (i.e. which can be directly replaced by
>   aio_co_wake()) in iscsi, nfs, nvme
> - curl: Yield in curl_do_preadv() (former curl_setup_preadv()) and
>   curl_find_buf() instead of returning whether curl_co_preadv() has to
>   yield or not
> - nvme: Added a patch that annotates some functions (primarily BHs and
>   CBs) with which AioContext they (must) run in
> - qcow2 cache-cleaning timer: Run the timer as a coroutine instead of in
>   a timer CB; use a CoQueue to await it exiting instead of polling
>   (well, we still need to poll in case we don’t run in a coroutine, but
>   that’s standard procedure, I believe)
>   - The need to initialize the CoQueue showed that there is a code path
>     in qcow2 that doesn’t initialize its CoMutex.  Added a patch to do
>     that.
>   - Also added a patch to have the timer use realtime instead of virtual
>     time.
> 
> 
> git backport-diff against v1:
> 
> Key:
> [----] : patches are identical
> [####] : number of functional differences between upstream/downstream patch
> [down] : patch is downstream-only
> The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
> 
> 001/19:[----] [--] 'block: Note on aio_co_wake use if not yet yielding'
> 002/19:[----] [--] 'rbd: Run co BH CB in the coroutine’s AioContext'
> 003/19:[0019] [FC] 'iscsi: Run co BH CB in the coroutine’s AioContext'
> 004/19:[0022] [FC] 'nfs: Run co BH CB in the coroutine’s AioContext'
> 005/19:[0060] [FC] 'curl: Fix coroutine waking'
> 006/19:[----] [--] 'gluster: Do not move coroutine into BDS context'
> 007/19:[----] [--] 'nvme: Kick and check completions in BDS context'
> 008/19:[0038] [FC] 'nvme: Fix coroutine waking'
> 009/19:[down] 'nvme: Note in which AioContext some functions run'
> 010/19:[----] [--] 'block/io: Take reqs_lock for tracked_requests'
> 011/19:[down] 'qcow2: Re-initialize lock in invalidate_cache'
> 012/19:[0145] [FC] 'qcow2: Fix cache_clean_timer'
> 013/19:[down] 'qcow2: Schedule cache-clean-timer in realtime'
> 014/19:[----] [--] 'ssh: Run restart_coroutine in current AioContext'
> 015/19:[----] [--] 'blkreplay: Run BH in coroutine’s AioContext'
> 016/19:[----] [--] 'block: Note in which AioContext AIO CBs are called'
> 017/19:[----] [--] 'iscsi: Create AIO BH in original AioContext'
> 018/19:[----] [--] 'null-aio: Run CB in original AioContext'
> 019/19:[----] [--] 'win32-aio: Run CB in original context'
> 
> 
> Hanna Czenczek (19):
>   block: Note on aio_co_wake use if not yet yielding
>   rbd: Run co BH CB in the coroutine’s AioContext
>   iscsi: Run co BH CB in the coroutine’s AioContext
>   nfs: Run co BH CB in the coroutine’s AioContext
>   curl: Fix coroutine waking
>   gluster: Do not move coroutine into BDS context
>   nvme: Kick and check completions in BDS context
>   nvme: Fix coroutine waking
>   nvme: Note in which AioContext some functions run
>   block/io: Take reqs_lock for tracked_requests
>   qcow2: Re-initialize lock in invalidate_cache
>   qcow2: Fix cache_clean_timer
>   qcow2: Schedule cache-clean-timer in realtime
>   ssh: Run restart_coroutine in current AioContext
>   blkreplay: Run BH in coroutine’s AioContext
>   block: Note in which AioContext AIO CBs are called
>   iscsi: Create AIO BH in original AioContext
>   null-aio: Run CB in original AioContext
>   win32-aio: Run CB in original context
> 
>  block/qcow2.h                    |   5 +-
>  include/block/aio.h              |  15 ++++
>  include/block/block_int-common.h |   7 +-
>  block/blkreplay.c                |   3 +-
>  block/curl.c                     |  45 +++++++---
>  block/gluster.c                  |  17 ++--
>  block/io.c                       |   3 +
>  block/iscsi.c                    |  63 ++++++--------
>  block/nfs.c                      |  41 ++++-----
>  block/null.c                     |   7 +-
>  block/nvme.c                     | 113 ++++++++++++++++--------
>  block/qcow2.c                    | 145 ++++++++++++++++++++++++-------
>  block/rbd.c                      |  12 +--
>  block/ssh.c                      |  22 ++---
>  block/win32-aio.c                |  31 +++++--
>  15 files changed, 347 insertions(+), 182 deletions(-)
> 
> -- 
> 2.51.1
> 

I reviewed the nvme changes and the core block layer changes:

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2025-11-17 19:11 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 15:48 [PATCH v2 00/19] block: Some multi-threading fixes Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 01/19] block: Note on aio_co_wake use if not yet yielding Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 02/19] rbd: Run co BH CB in the coroutine’s AioContext Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 03/19] iscsi: " Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 04/19] nfs: " Hanna Czenczek
2026-03-03 19:24   ` Peter Lieven
2026-03-04 16:02     ` Peter Lieven
2026-03-06 13:41     ` Hanna Czenczek
2026-03-06 13:57       ` Peter Lieven
2026-03-06 15:30         ` Kevin Wolf
2025-11-10 15:48 ` [PATCH v2 05/19] curl: Fix coroutine waking Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 06/19] gluster: Do not move coroutine into BDS context Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 07/19] nvme: Kick and check completions in " Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 08/19] nvme: Fix coroutine waking Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 09/19] nvme: Note in which AioContext some functions run Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 10/19] block/io: Take reqs_lock for tracked_requests Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 11/19] qcow2: Re-initialize lock in invalidate_cache Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 12/19] qcow2: Fix cache_clean_timer Hanna Czenczek
2025-11-17 14:50   ` Kevin Wolf
2025-11-18 11:01     ` Hanna Czenczek
2025-11-18 17:06       ` Kevin Wolf
2025-11-18 17:19         ` Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 13/19] qcow2: Schedule cache-clean-timer in realtime Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 14/19] ssh: Run restart_coroutine in current AioContext Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 15/19] blkreplay: Run BH in coroutine’s AioContext Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 16/19] block: Note in which AioContext AIO CBs are called Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 17/19] iscsi: Create AIO BH in original AioContext Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 18/19] null-aio: Run CB " Hanna Czenczek
2025-11-10 15:48 ` [PATCH v2 19/19] win32-aio: Run CB in original context Hanna Czenczek
2025-11-17 15:11 ` [PATCH v2 00/19] block: Some multi-threading fixes Kevin Wolf
2025-11-17 19:11 ` Stefan Hajnoczi [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=20251117191129.GA91711@fedora \
    --to=stefanha@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pl@dlhnet.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=ronniesahlberg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.