[RFC 2/3] block: use LARGE_ZERO_PAGE in __blkdev_issue_zero_pages()
From: Pankaj Raghav
Date: Fri May 16 2025 - 06:11:59 EST
Use LARGE_ZERO_PAGE in __blkdev_issue_zero_pages() instead of ZERO_PAGE.
On systems that support LARGE_ZERO_PAGE, we will end up sending larger
bvecs instead of multiple small ones.
Noticed a 4% increase in performance on a commercial NVMe SSD which does
not support OP_WRITE_ZEROES. The performance gains might be bigger if
the device supports larger MDTS.
Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
---
block/blk-lib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-lib.c b/block/blk-lib.c
index 4c9f20a689f7..80dfc737d1f6 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -211,8 +211,8 @@ static void __blkdev_issue_zero_pages(struct block_device *bdev,
unsigned int len, added;
len = min_t(sector_t,
- PAGE_SIZE, nr_sects << SECTOR_SHIFT);
- added = bio_add_page(bio, ZERO_PAGE(0), len, 0);
+ ZERO_LARGE_PAGE_SIZE, nr_sects << SECTOR_SHIFT);
+ added = bio_add_page(bio, ZERO_LARGE_PAGE(0), len, 0);
if (added < len)
break;
nr_sects -= added >> SECTOR_SHIFT;
--
2.47.2