diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-05-23 11:23:30 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-06-18 12:13:06 -0300 |
commit | 8a1a0cd0b770a0f40a49db923479879fa7135aae (patch) | |
tree | 6f77990d5495984f3d0106d22008cb63439c7c1f /mm | |
parent | 47f245985a4f3e270b1e4f28aa49f4c939527981 (diff) | |
download | linux-stable-8a1a0cd0b770a0f40a49db923479879fa7135aae.tar.gz linux-stable-8a1a0cd0b770a0f40a49db923479879fa7135aae.tar.bz2 linux-stable-8a1a0cd0b770a0f40a49db923479879fa7135aae.zip |
mm/hmm: Use lockdep instead of comments
So we can check locking at runtime.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Acked-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Philip Yang <Philip.Yang@amd.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hmm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -246,11 +246,11 @@ static const struct mmu_notifier_ops hmm_mmu_notifier_ops = { * * To start mirroring a process address space, the device driver must register * an HMM mirror struct. - * - * THE mm->mmap_sem MUST BE HELD IN WRITE MODE ! */ int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm) { + lockdep_assert_held_exclusive(&mm->mmap_sem); + /* Sanity check */ if (!mm || !mirror || !mirror->ops) return -EINVAL; |