Re: [PATCH] iov_iter: Fix direct I/O across compatible device pgmaps
From: David Hildenbrand (Arm)
Date: Mon Nov 30 2026 - 05:57:18 EST
On 11/30/26 05:44, Naman Jain wrote:
>
>
> On 11/29/2026 4:02 PM, David Hildenbrand (Arm) wrote:
>> On 11/27/26 05:05, Naman Jain wrote:
>>>
>>>
>>>
>>> IIUC, you want me to change this comment to kernel doc, something like this.
>>>
>>> /**
>>> * zone_device_pages_compatible() - Check if pages can share a bio
>>> * @a: First page
>>> * @b: Second page
>>> *
>>> * Check if two pages from potentially different zone device pgmaps can
>>> * coexist as separate bvec entries in the same bio.
>>> *
>>> * The block DMA iterator (blk_dma_map_iter_start()) caches the P2PDMA
>>> * mapping state from the first segment and applies it to all subsequent
>>> * segments, so P2PDMA pages from different pgmaps must not be mixed in
>>> * the same bio.
>>> *
>>> * Other zone device types (FS_DAX, GENERIC) use the same dma_map_phys()
>>> * path as normal RAM. PRIVATE and COHERENT pages never appear in bios.
>>> *
>>> * Return: %true if the pages can coexist as separate bvec entries in the
>>> * same bio, otherwise %false.
>>> */
>>>
>>> I can do that in next version. Thanks.
>>
>>
>> Yeah, can we rename the function while moving it? in bio.h the "bio" context was
>> quite clear. In memremap.h it's a bit weird.
>>
>> If this is all about bios, I'd squeeze that into the filename and make it
>> clearer for *what* they are compatible.
>>
>
> zone_device_pages_bio_compatible() is an alternative. Please let me know
> if this looks good.
Yeah, something like that is clearer.
--
Cheers,
David