[PATCH 1/9] block: don't merge different kinds of P2P transfers in a single bio

Christoph Hellwig hch at lst.de
Thu Jun 12 23:19:12 PDT 2025


On Thu, Jun 12, 2025 at 11:54:21AM +0530, Kanchan Joshi wrote:
> On 6/10/2025 10:36 AM, Christoph Hellwig wrote:
> > --- a/block/bio.c
> > +++ b/block/bio.c
> > @@ -930,8 +930,6 @@ static bool bvec_try_merge_page(struct bio_vec *bv, struct page *page,
> >   		return false;
> >   	if (xen_domain() && !xen_biovec_phys_mergeable(bv, page))
> >   		return false;
> > -	if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
> > -		return false;
> 
> I did not understand the value of moving this out to its two callers 
> (bio_add_page and bio_integrity_add_page).
> 
> Since this check existed, I am a bit confused. The thing that patch 
> title says - is not a new addition and used to happen earlier too?
> Or is this about setting REQ_NOMERGE in bio?

It is about not merging mismatch pgmaps into a bio, for which it needs
to be in the caller.  The current code only prevents merges into the
same bio_vec.



More information about the Linux-nvme mailing list