[PATCH 10/13] PCI/P2PDMA: support compound page in p2pmem_alloc_mmap()
Logan Gunthorpe
logang at deltatee.com
Wed Jan 7 13:22:53 PST 2026
On 2026-01-07 13:24, Jason Gunthorpe wrote:
> On Mon, Dec 22, 2025 at 10:04:17AM -0700, Logan Gunthorpe wrote:
>> I would have expected this code to allocate an appropriately aligned
>> block of the p2p memory based on the requirements of the current
>> mapping, not based on alignment requirements established when the device
>> is probed.
>
> Yeah, I think this is not right too.
>
> I think the flow has become confused by trying to set a static
> vmemmap_shift when creating the pgmap. That is not how something like
> this should work at all.
>
> Instead the basic idea should be that each mmap systemcall will
> determine what folio order it would like to have, it will allocate an
> aligned range of physical from the genpool, and then it will alter the
> folios in that range into a single high order folio.
>
> Finally the high order folio is installed in one shot with the mm
> dealing with placing it optimally in the right page table levels.
This all sounds the same as what I was advocating for. genpool does
still need to be modified to support the specified alignment
requirements for the allocation.
If there is more help from the VM layer to insert different orders of
memory, that would be fantastic too.
Logan
More information about the Linux-nvme
mailing list