[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d2714eb-f5fc-4e73-9114-8d644deccdcc@deltatee.com>
Date: Wed, 7 Jan 2026 14:22:53 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Hou Tao <houtao@...weicloud.com>, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-mm@...ck.org,
linux-nvme@...ts.infradead.org, Bjorn Helgaas <bhelgaas@...gle.com>,
Alistair Popple <apopple@...dia.com>, Leon Romanovsky <leonro@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Tejun Heo <tj@...nel.org>,
"Rafael J . Wysocki" <rafael@...nel.org>, Danilo Krummrich
<dakr@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Keith Busch
<kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
houtao1@...wei.com
Subject: Re: [PATCH 10/13] PCI/P2PDMA: support compound page in
p2pmem_alloc_mmap()
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
Powered by blists - more mailing lists