Re: [PATCH 2/2] block: allow different-pgmap pages as separate bvecs in bio_add_page
From: Christoph Hellwig
Date: Wed Apr 01 2026 - 10:19:52 EST
On Wed, Apr 01, 2026 at 08:23:29AM +0000, Naman Jain wrote:
> bio_add_page() and bio_integrity_add_page() reject pages from a
> different dev_pagemap entirely, returning 0 even when the page could
> be added as a new bvec entry. The pgmap check was intended only to
> prevent merging into the same bvec segment, not to block the page
> from being added at all.
>
> This causes callers to unnecessarily start a new bio when a buffer
> spans pages from two different pgmaps, even though the bio has room
> for another bvec.
This is not unnecessary. A single dma mapping operation can only
map a single target pgmap. The old SG API works around this by
doing multiple mapping operation underneath, but compared to that
just having multiple bios is much easier and more efficient.
What is your use case here?