Re: [PATCH 2/2] block: allow different-pgmap pages as separate bvecs in bio_add_page
From: Christoph Hellwig
Date: Wed Apr 08 2026 - 02:08:48 EST
Hi Naman,
On Tue, Apr 07, 2026 at 12:38:30PM +0530, Naman Jain wrote:
>> 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.
>
> Ok, so rest all things same, from my last email, but my previous compatible
> function would look like this:
>
> static inline bool zone_device_pages_compatible(const struct page *a,
> const struct page *b)
> {
> if (is_pci_p2pdma_page(a) || is_pci_p2pdma_page(b))
> return zone_device_pages_have_same_pgmap(a, b);
> return true;
> }
>
> This would prevent two P2PDMA pages from different pgmaps (different PCI
> devices) passing the compatible check and both get added to the bio.
> Please correct me if that is not what you meant. I'll wait for a couple
> more days and send the next version with this, and we can review this
> again.
This looks good modulo the tabs vs spaces in the indentation.