Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-12-05 Thread Roger Pau Monné
On Wed, Dec 02, 2020 at 11:08:54AM +0100, Christoph Hellwig wrote: > On Fri, Nov 20, 2020 at 04:01:33PM -0400, Jason Gunthorpe wrote: > > On Wed, Nov 11, 2020 at 03:38:42PM -0800, Ralph Campbell wrote: > > > > > MEMORY_DEVICE_GENERIC: > > > Struct pages are created in dev_dax_probe() and

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-12-02 Thread Logan Gunthorpe
On 2020-12-02 3:14 a.m., Christoph Hellwig wrote:>> MEMORY_DEVICE_PCI_P2PDMA: >> Struct pages are created in pci_p2pdma_add_resource() and represent device >> memory accessible by PCIe bar address space. Memory is allocated with >> pci_alloc_p2pmem() based on a byte length but the

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-12-02 Thread Christoph Hellwig
[adding a few of the usual suspects] On Wed, Nov 11, 2020 at 03:38:42PM -0800, Ralph Campbell wrote: > There are 4 types of ZONE_DEVICE struct pages: > MEMORY_DEVICE_PRIVATE, MEMORY_DEVICE_FS_DAX, MEMORY_DEVICE_GENERIC, and > MEMORY_DEVICE_PCI_P2PDMA. > > Currently, memremap_pages() allocates

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-12-02 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 04:01:33PM -0400, Jason Gunthorpe wrote: > On Wed, Nov 11, 2020 at 03:38:42PM -0800, Ralph Campbell wrote: > > > MEMORY_DEVICE_GENERIC: > > Struct pages are created in dev_dax_probe() and represent non-volatile > > memory. > > The device can be mmap()'ed which calls

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-20 Thread Jason Gunthorpe
On Wed, Nov 11, 2020 at 03:38:42PM -0800, Ralph Campbell wrote: > MEMORY_DEVICE_GENERIC: > Struct pages are created in dev_dax_probe() and represent non-volatile memory. > The device can be mmap()'ed which calls dax_mmap() which sets > vma->vm_flags | VM_HUGEPAGE. > A CPU page fault will result

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-11 Thread Ralph Campbell
On 11/9/20 1:14 AM, Christoph Hellwig wrote: On Fri, Nov 06, 2020 at 01:26:50PM -0800, Ralph Campbell wrote: On 11/6/20 12:03 AM, Christoph Hellwig wrote: I hate the extra pin count magic here. IMHO we really need to finish off the series to get rid of the extra references on the

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-09 Thread Ralph Campbell
On 11/9/20 1:14 AM, Christoph Hellwig wrote: On Fri, Nov 06, 2020 at 01:26:50PM -0800, Ralph Campbell wrote: On 11/6/20 12:03 AM, Christoph Hellwig wrote: I hate the extra pin count magic here. IMHO we really need to finish off the series to get rid of the extra references on the

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-09 Thread Christoph Hellwig
On Fri, Nov 06, 2020 at 01:26:50PM -0800, Ralph Campbell wrote: > > On 11/6/20 12:03 AM, Christoph Hellwig wrote: >> I hate the extra pin count magic here. IMHO we really need to finish >> off the series to get rid of the extra references on the ZONE_DEVICE >> pages first. > > First, thanks for

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-06 Thread Ralph Campbell
On 11/6/20 12:03 AM, Christoph Hellwig wrote: I hate the extra pin count magic here. IMHO we really need to finish off the series to get rid of the extra references on the ZONE_DEVICE pages first. First, thanks for the review comments. I don't like the extra refcount either, that is why I

Re: [PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-06 Thread Christoph Hellwig
I hate the extra pin count magic here. IMHO we really need to finish off the series to get rid of the extra references on the ZONE_DEVICE pages first.

[PATCH v3 3/6] mm: support THP migration to device private memory

2020-11-05 Thread Ralph Campbell
Support transparent huge page migration to ZONE_DEVICE private memory. A new selection flag (MIGRATE_VMA_SELECT_COMPOUND) is added to request THP migration. Otherwise, THPs are split when filling in the source PFN array. A new flag (MIGRATE_PFN_COMPOUND) is added to the source PFN array to