[Devel] [PATCH RH9 v4 10/10] drivers/vhost: queue vhost_blk works at vq workers

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Tue Nov 1 10:25:36 MSK 2022


Update vhost_blk to queue works on virtqueue workers. Together
with previous changes this allows us to split virtio blk requests
across several threads.

                        | randread, IOPS | randwrite, IOPS |
8vcpu, 1 kernel worker  |      576k      |      575k       |
8vcpu, 2 kernel workers |      803k      |      779k       |

https://jira.sw.ru/browse/PSBM-139414
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 drivers/vhost/blk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
index 7a29e65d57d1..dce339a8220f 100644
--- a/drivers/vhost/blk.c
+++ b/drivers/vhost/blk.c
@@ -161,7 +161,6 @@ static inline int vhost_blk_set_status(struct vhost_blk_req *req, u8 status)
 static void vhost_blk_req_done(struct bio *bio)
 {
 	struct vhost_blk_req *req = bio->bi_private;
-	struct vhost_blk *blk = req->blk;
 	int err = blk_status_to_errno(bio->bi_status);
 
 	if (err)
@@ -169,7 +168,7 @@ static void vhost_blk_req_done(struct bio *bio)
 
 	if (atomic_dec_and_test(&req->bio_nr)) {
 		llist_add(&req->llnode, &req->blk_vq->llhead);
-		vhost_work_queue(&blk->dev, &req->blk_vq->work);
+		vhost_work_queue_vq(&req->blk_vq->vq, &req->blk_vq->work);
 	}
 
 	bio_put(bio);
-- 
2.31.1



More information about the Devel mailing list