Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-17 Thread Christoph Hellwig
On Sat, Aug 17, 2019 at 11:05:36AM +1000, Ben Skeggs wrote: > > >> constants with similar names and identical values, and those are used > > >> in mmu/vmmgp100.c and what appears to finally do the low-level dma > > >> mapping and talking to the hardware. Are these two sets of constants > > >>

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-16 Thread Ben Skeggs
On Fri, Aug 16, 2019 at 5:11 PM Christoph Hellwig wrote: > > On Mon, Aug 12, 2019 at 12:42:30PM -0700, Ralph Campbell wrote: > > > > On 8/10/19 4:13 AM, Christoph Hellwig wrote: > >> On something vaguely related to this patch: > >> > >> You use the NVIF_VMM_PFNMAP_V0_V* defines from

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-16 Thread Christoph Hellwig
On Mon, Aug 12, 2019 at 12:42:30PM -0700, Ralph Campbell wrote: > > On 8/10/19 4:13 AM, Christoph Hellwig wrote: >> On something vaguely related to this patch: >> >> You use the NVIF_VMM_PFNMAP_V0_V* defines from nvif/if000c.h, which are >> a little odd as we only ever set these bits, but they

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-15 Thread Jerome Glisse
On Tue, Aug 13, 2019 at 05:58:52PM -0400, Jerome Glisse wrote: > On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > > When memory is migrated to the GPU it is likely to be accessed by GPU > > code soon afterwards. Instead of waiting for a GPU fault, map the > > migrated memory into

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-13 Thread Jerome Glisse
On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > When memory is migrated to the GPU it is likely to be accessed by GPU > code soon afterwards. Instead of waiting for a GPU fault, map the > migrated memory into the GPU page tables with the same access permissions > as the source

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-10 Thread Christoph Hellwig
On Thu, Aug 08, 2019 at 02:29:34PM -0700, Ralph Campbell wrote: >>> { >>> struct nouveau_fence *fence; >>> unsigned long addr = args->start, nr_dma = 0, i; >>> for (i = 0; addr < args->end; i++) { >>> args->dst[i] = nouveau_dmem_migrate_copy_one(drm, args->vma,

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-08 Thread Christoph Hellwig
On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > When memory is migrated to the GPU it is likely to be accessed by GPU > code soon afterwards. Instead of waiting for a GPU fault, map the > migrated memory into the GPU page tables with the same access permissions > as the source

[Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-07 Thread Ralph Campbell
When memory is migrated to the GPU it is likely to be accessed by GPU code soon afterwards. Instead of waiting for a GPU fault, map the migrated memory into the GPU page tables with the same access permissions as the source CPU page table entries. This preserves copy on write semantics.