[Devel] [PATCH RHEL9 COMMIT] vhost-blk: don't allocate biovec for flush

Konstantin Khorenko khorenko at virtuozzo.com
Fri Nov 15 17:46:07 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-427.37.1.vz9.78.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.37.1.vz9.78.4
------>
commit 66f13fa75395f28206b9e92c54544ab876e00683
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Wed Nov 6 17:20:29 2024 +0800

    vhost-blk: don't allocate biovec for flush
    
    There is no point in adding even one vector as we don't add any pages
    to it. E.g. dispatch_rw_block_io(), blkdev_issue_flush() or
    async_pmem_flush() where zero vectors are used for flush requests.
    
    Fixes: 17bfe6e0400da ("drivers/vhost: vhost-blk accelerator for virtio-blk guests")
    https://virtuozzo.atlassian.net/browse/VSTOR-94596
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    
    Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
---
 drivers/vhost/blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
index 9ef51335449f..cd8d71c28bbd 100644
--- a/drivers/vhost/blk.c
+++ b/drivers/vhost/blk.c
@@ -205,7 +205,7 @@ static int vhost_blk_bio_make_simple(struct vhost_blk_req *req,
 	req->pl = NULL;
 	req->bio = req->inline_bio;
 
-	bio = bio_alloc(bdev, 1, req->bi_opf, GFP_KERNEL);
+	bio = bio_alloc(bdev, 0, req->bi_opf, GFP_KERNEL);
 	if (!bio)
 		return -ENOMEM;
 


More information about the Devel mailing list