Skip to content

Commit

Permalink
mm/hmm: Use lockdep instead of comments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gunthorpe committed Jun 18, 2019
1 parent 47f2459 commit 8a1a0cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/hmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a1a0cd

Please sign in to comment.