nouveau: use mmu_interval_notifier instead of hmm_mirror
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 12 Nov 2019 20:22:26 +0000 (16:22 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Sat, 23 Nov 2019 23:56:44 +0000 (19:56 -0400)
commit20fef4ef84bfb07d3658ff1347951c489fe7bafa
treebbd869d0d061cb4f354b0a7a78bdbd03e201683b
parentc625c274ee0058c2a04aa0d794314b5b277606b2
nouveau: use mmu_interval_notifier instead of hmm_mirror

Remove the hmm_mirror object and use the mmu_interval_notifier API instead
for the range, and use the normal mmu_notifier API for the general
invalidation callback.

While here re-organize the pagefault path so the locking pattern is clear.

nouveau is the only driver that uses a temporary range object and instead
forwards nearly every invalidation range directly to the HW. While this is
not how the mmu_interval_notifier was intended to be used, the overheads on
the pagefaulting path are similar to the existing hmm_mirror version.
Particularly since the interval tree will be small.

Link: https://lore.kernel.org/r/20191112202231.3856-10-jgg@ziepe.ca
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/gpu/drm/nouveau/nouveau_svm.c