From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Hanna Reitz" <hreitz@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
kwolf@redhat.com, qemu-block@nongnu.org,
"Klaus Jensen" <its@irrelevant.dk>,
"John Snow" <jsnow@redhat.com>, "Cleber Rosa" <crosa@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Keith Busch" <kbusch@kernel.org>,
"David Hildenbrand" <david@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Peter Xu" <peterx@redhat.com>, "Fam Zheng" <fam@euphon.net>
Subject: [PATCH v2 3/4] block-backend: process zoned requests in the current AioContext
Date: Wed, 23 Aug 2023 19:59:37 -0400 [thread overview]
Message-ID: <20230823235938.1398382-4-stefanha@redhat.com> (raw)
In-Reply-To: <20230823235938.1398382-1-stefanha@redhat.com>
Process zoned requests in the current thread's AioContext instead of in
the BlockBackend's AioContext.
There is no need to use the BlockBackend's AioContext thanks to CoMutex
bs->wps->colock, which protects zone metadata.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/block-backend.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index 4863be5691..427ebcc0e4 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1890,11 +1890,11 @@ BlockAIOCB *blk_aio_zone_report(BlockBackend *blk, int64_t offset,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_report_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}
@@ -1931,11 +1931,11 @@ BlockAIOCB *blk_aio_zone_mgmt(BlockBackend *blk, BlockZoneOp op,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_mgmt_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}
@@ -1971,10 +1971,10 @@ BlockAIOCB *blk_aio_zone_append(BlockBackend *blk, int64_t *offset,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_append_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}
--
2.41.0
next prev parent reply other threads:[~2023-08-24 0:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 23:59 [PATCH v2 0/4] block-backend: process I/O in the current AioContext Stefan Hajnoczi
2023-08-23 23:59 ` [PATCH v2 1/4] block: remove AIOCBInfo->get_aio_context() Stefan Hajnoczi
2023-08-23 23:59 ` [PATCH v2 2/4] block-backend: process I/O in the current AioContext Stefan Hajnoczi
2023-08-23 23:59 ` Stefan Hajnoczi [this message]
2023-08-23 23:59 ` [PATCH v2 4/4] block-coroutine-wrapper: use qemu_get_current_aio_context() Stefan Hajnoczi
2023-09-01 17:01 ` Kevin Wolf
2023-09-12 21:37 ` Stefan Hajnoczi
2023-09-04 9:05 ` [PATCH v2 0/4] block-backend: process I/O in the current AioContext Kevin Wolf
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=20230823235938.1398382-4-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=crosa@redhat.com \
--cc=david@redhat.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=its@irrelevant.dk \
--cc=jsnow@redhat.com \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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).