Re: [Nouveau] [PATCH v3 2/6] mm/migrate: move migrate_vma_collect_skip()

2020-11-05 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau

Re: [Nouveau] [PATCH v3 2/6] mm/migrate: move migrate_vma_collect_skip()

2020-11-05 Thread Christoph Hellwig
On Thu, Nov 05, 2020 at 04:51:43PM -0800, Ralph Campbell wrote: > Move the definition of migrate_vma_collect_skip() to make it callable > by migrate_vma_collect_hole(). This helps make the next patch easier > to read. > > Signed-off-by: Ralph Campbell Looks good, Reviewed-by: Christoph Hellwig

[Nouveau] [PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres

2020-11-05 Thread Jeremy Cline
Make use of the devm_drm_dev_alloc() API to bind the lifetime of nouveau_drm structure to the drm_device. This is important because a reference to nouveau_drm is accessible from drm_device, which is provided to a number of DRM layer callbacks that can run after the deallocation of nouveau_drm

[Nouveau] [PATCH 3/3] drm/nouveau: begin documenting core nouveau structures

2020-11-05 Thread Jeremy Cline
Start on documentation for the Nouveau device structure and the NVIF client structure it uses. This documentation is not complete as the structures are non-trivial and I am not familiar with large portions of them. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drv.h | 67

[Nouveau] [PATCH 1/3] drm/nouveau: Use helper to convert nouveau_drm to drm_device

2020-11-05 Thread Jeremy Cline
In order to use the resource-managed allocation of a struct drm_device instance, it is recommended to embed the drm_device instance within the driver-specific structure. As there is already a helper to convert a drm_device to a nouveau_drm struct, this adds an inverse function and changes all

[Nouveau] [PATCH 0/3] drm/nouveau: extend the lifetime of nouveau_drm

2020-11-05 Thread Jeremy Cline
Hi folks, Currently, when the device is removed (or the driver is unbound) the nouveau_drm structure de-allocated. However, it's still accessible from and used by some DRM layer callbacks. For example, file handles can be closed after the device has been removed (physically or otherwise). This

[Nouveau] [PATCH v3 1/6] mm/thp: add prep_transhuge_device_private_page()

2020-11-05 Thread Ralph Campbell
Add a helper function to allow device drivers to create device private transparent huge pages. This is intended to help support device private THP migrations. Signed-off-by: Ralph Campbell --- include/linux/huge_mm.h | 5 + mm/huge_memory.c| 9 + 2 files changed, 14

[Nouveau] [PATCH v3 6/6] nouveau: support THP migration to private memory

2020-11-05 Thread Ralph Campbell
Add support for migrating transparent huge pages to and from device private memory. Signed-off-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 289 ++--- drivers/gpu/drm/nouveau/nouveau_svm.c | 11 +- drivers/gpu/drm/nouveau/nouveau_svm.h | 3 +- 3 files

[Nouveau] [PATCH v3 4/6] mm/thp: add THP allocation helper

2020-11-05 Thread Ralph Campbell
Transparent huge page allocation policy is controlled by several sysfs variables. Rather than expose these to each device driver that needs to allocate THPs, provide a helper function. Signed-off-by: Ralph Campbell --- include/linux/gfp.h | 10 ++ mm/huge_memory.c| 14 ++

[Nouveau] [PATCH v3 5/6] mm/hmm/test: add self tests for THP migration

2020-11-05 Thread Ralph Campbell
Add some basic stand alone self tests for migrating system memory to device private memory and back. Signed-off-by: Ralph Campbell --- lib/test_hmm.c | 437 + lib/test_hmm_uapi.h| 3 + tools/testing/selftests/vm/hmm-tests.c |

[Nouveau] [PATCH v3 0/6] mm/hmm/nouveau: add THP migration to migrate_vma_*

2020-11-05 Thread Ralph Campbell
This series adds support for transparent huge page migration to migrate_vma_*() and adds nouveau SVM and HMM selftests as consumers. Earlier versions were posted previously [1] and [2]. The patches apply cleanly to the linux-mm 5.10.0-rc2 tree. There are a lot of other THP patches being posted. I

[Nouveau] [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