]> asedeno.scripts.mit.edu Git - linux.git/commit
mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 23 May 2019 12:41:19 +0000 (09:41 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 10 Jun 2019 13:10:30 +0000 (10:10 -0300)
commite36acfe6c86d13eec62321e1e86a1ce287e52e7d
treedce3ca3311aa436c629a5443b126dd73865177df
parent6d7c3cde93c1d9ac0b37f78ec3f2ff052159a242
mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register

Ralph observes that hmm_range_register() can only be called by a driver
while a mirror is registered. Make this clear in the API by passing in the
mirror structure as a parameter.

This also simplifies understanding the lifetime model for struct hmm, as
the hmm pointer must be valid as part of a registered mirror so all we
need in hmm_register_range() is a simple kref_get.

Suggested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Philip Yang <Philip.Yang@amd.com>
drivers/gpu/drm/nouveau/nouveau_svm.c
include/linux/hmm.h
mm/hmm.c