Skip to content

Commit

Permalink
mm/hmm: Do not use list*_rcu() for hmm->ranges
Browse files Browse the repository at this point in the history
This list is always read and written while holding hmm->lock so there is
no need for the confusing _rcu annotations.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Ira Weiny <iweiny@intel.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 378a604 commit 157816f
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 @@ -912,7 +912,7 @@ int hmm_range_register(struct hmm_range *range,

range->hmm = hmm;
kref_get(&hmm->kref);
list_add_rcu(&range->list, &hmm->ranges);
list_add(&range->list, &hmm->ranges);

/*
* If there are any concurrent notifiers we have to wait for them for
Expand Down Expand Up @@ -942,7 +942,7 @@ void hmm_range_unregister(struct hmm_range *range)
return;

mutex_lock(&hmm->lock);
list_del_rcu(&range->list);
list_del(&range->list);
mutex_unlock(&hmm->lock);

/* Drop reference taken by hmm_range_register() */
Expand Down

0 comments on commit 157816f

Please sign in to comment.