[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/33] virtio-blk: don't lock AioContext in the submission code pa
From: |
Kevin Wolf |
Subject: |
[PULL 07/33] virtio-blk: don't lock AioContext in the submission code path |
Date: |
Thu, 21 Dec 2023 22:23:12 +0100 |
From: Stefan Hajnoczi <stefanha@redhat.com>
There is no need to acquire the AioContext lock around blk_aio_*() or
blk_get_geometry() anymore. I/O plugging (defer_call()) also does not
require the AioContext lock anymore.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230914140101.1065008-5-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
hw/block/virtio-blk.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index f5315df042..e110f9718b 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -1111,7 +1111,6 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq)
MultiReqBuffer mrb = {};
bool suppress_notifications = virtio_queue_get_notification(vq);
- aio_context_acquire(blk_get_aio_context(s->blk));
defer_call_begin();
do {
@@ -1137,7 +1136,6 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq)
}
defer_call_end();
- aio_context_release(blk_get_aio_context(s->blk));
}
static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)
@@ -1168,7 +1166,6 @@ static void virtio_blk_dma_restart_bh(void *opaque)
s->rq = NULL;
}
- aio_context_acquire(blk_get_aio_context(s->conf.conf.blk));
while (req) {
VirtIOBlockReq *next = req->next;
if (virtio_blk_handle_request(req, &mrb)) {
@@ -1192,8 +1189,6 @@ static void virtio_blk_dma_restart_bh(void *opaque)
/* Paired with inc in virtio_blk_dma_restart_cb() */
blk_dec_in_flight(s->conf.conf.blk);
-
- aio_context_release(blk_get_aio_context(s->conf.conf.blk));
}
static void virtio_blk_dma_restart_cb(void *opaque, bool running,
--
2.43.0
- [PULL 00/33] Block layer patches, Kevin Wolf, 2023/12/21
- [PULL 01/33] nbd/server: avoid per-NBDRequest nbd_client_get/put(), Kevin Wolf, 2023/12/21
- [PULL 03/33] nbd/server: introduce NBDClient->lock to protect fields, Kevin Wolf, 2023/12/21
- [PULL 05/33] virtio-blk: add lock to protect s->rq, Kevin Wolf, 2023/12/21
- [PULL 04/33] block/file-posix: set up Linux AIO and io_uring in the current thread, Kevin Wolf, 2023/12/21
- [PULL 02/33] nbd/server: only traverse NBDExport->clients from main loop thread, Kevin Wolf, 2023/12/21
- [PULL 06/33] virtio-blk: don't lock AioContext in the completion code path, Kevin Wolf, 2023/12/21
- [PULL 07/33] virtio-blk: don't lock AioContext in the submission code path,
Kevin Wolf <=
- [PULL 09/33] vl: Improve error message for conflicting -incoming and -loadvm, Kevin Wolf, 2023/12/21
- [PULL 08/33] block: Fix crash when loading snapshot on inactive node, Kevin Wolf, 2023/12/21
- [PULL 10/33] iotests: Basic tests for internal snapshots, Kevin Wolf, 2023/12/21
- [PULL 11/33] scsi: only access SCSIDevice->requests from one thread, Kevin Wolf, 2023/12/21
- [PULL 12/33] virtio-scsi: don't lock AioContext around virtio_queue_aio_attach_host_notifier(), Kevin Wolf, 2023/12/21
- [PULL 13/33] scsi: don't lock AioContext in I/O code path, Kevin Wolf, 2023/12/21
- [PULL 14/33] dma-helpers: don't lock AioContext in dma_blk_cb(), Kevin Wolf, 2023/12/21
- [PULL 15/33] virtio-scsi: replace AioContext lock with tmf_bh_lock, Kevin Wolf, 2023/12/21
- [PULL 16/33] scsi: assert that callbacks run in the correct AioContext, Kevin Wolf, 2023/12/21
- [PULL 17/33] tests: remove aio_context_acquire() tests, Kevin Wolf, 2023/12/21