linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Raghav <p.raghav@samsung.com>
To: "Darrick J . Wong" <djwong@kernel.org>, hch@lst.de, willy@infradead.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	David Hildenbrand <david@redhat.com>,
	linux-fsdevel@vger.kernel.org, mcgrof@kernel.org,
	gost.dev@samsung.com, Andrew Morton <akpm@linux-foundation.org>,
	kernel@pankajraghav.com, Pankaj Raghav <p.raghav@samsung.com>
Subject: [RFC 2/3] block: use LARGE_ZERO_PAGE in __blkdev_issue_zero_pages()
Date: Fri, 16 May 2025 12:10:53 +0200	[thread overview]
Message-ID: <20250516101054.676046-3-p.raghav@samsung.com> (raw)
In-Reply-To: <20250516101054.676046-1-p.raghav@samsung.com>

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@samsung.com>
---
 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



  parent reply	other threads:[~2025-05-16 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 10:10 [RFC 0/3] add large zero page for zeroing out larger segments Pankaj Raghav
2025-05-16 10:10 ` [RFC 1/3] mm: add large zero page for efficient zeroing of " Pankaj Raghav
2025-05-16 12:21   ` David Hildenbrand
2025-05-16 13:03     ` Pankaj Raghav (Samsung)
2025-05-16 14:54       ` David Hildenbrand
2025-05-16 10:10 ` Pankaj Raghav [this message]
2025-05-16 10:10 ` [RFC 3/3] iomap: use LARGE_ZERO_PAGE in iomap_dio_zero() Pankaj Raghav

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=20250516101054.676046-3-p.raghav@samsung.com \
    --to=p.raghav@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=djwong@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=kernel@pankajraghav.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=willy@infradead.org \
    /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