]> git.baikalelectronics.ru Git - kernel.git/commit
nouveau/svm: Fix to migrate all requested pages
authorAlistair Popple <apopple@nvidia.com>
Wed, 20 Jul 2022 06:27:45 +0000 (16:27 +1000)
committerLyude Paul <lyude@redhat.com>
Thu, 28 Jul 2022 20:43:31 +0000 (16:43 -0400)
commit7fa0943b8b1dd2274c1dd0bb3392816b12a893e7
tree5da17daacb6baf645430a1741634464a2738f2ad
parent287d2fe4ec129c1a4215b079d877c5ff80e04bd7
nouveau/svm: Fix to migrate all requested pages

Users may request that pages from an OpenCL SVM allocation be migrated
to the GPU with clEnqueueSVMMigrateMem(). In Nouveau this will call into
nouveau_dmem_migrate_vma() to do the migration. If the total range to be
migrated exceeds SG_MAX_SINGLE_ALLOC the pages will be migrated in
chunks of size SG_MAX_SINGLE_ALLOC. However a typo in updating the
starting address means that only the first chunk will get migrated.

Fix the calculation so that the entire range will get migrated if
possible.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
Fixes: f6e01c3642a3 ("drm/nouveau/svm: map pages after migration")
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220720062745.960701-1-apopple@nvidia.com
Cc: <stable@vger.kernel.org> # v5.8+
drivers/gpu/drm/nouveau/nouveau_dmem.c