Re: [PATCH 2/2] block: allow different-pgmap pages as separate bvecs in bio_add_page

From: Christoph Hellwig

Date: Tue Apr 07 2026 - 01:53:08 EST


> - if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
> + if (!zone_device_pages_compatible(bv->bv_page, page))
> return 0;
> -
> - if (bvec_try_merge_hw_page(q, bv, page, len, offset)) {
> + if (zone_device_pages_have_same_pgmap(bv->bv_page, page) &&
> + bvec_try_merge_hw_page(q, bv, page, len, offset)) {

We still can't merge merge pages with different P2P pgmaps into the
same request.

So the zone_device_pages_have_same_pgmap check should go into
zone_device_pages_compatible and we need to stop building the bio
as well in that case.