summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-09-16 19:48:10 +0200
committerDoug Ledford <dledford@redhat.com>2018-09-21 17:58:36 +0200
commitbe7a57b41ad824dbc59d1ffa91160ee73f2999ee (patch)
tree4169879247114dbfd027d0da322fc6f1dbf4c82e /include/rdma
parentRDMA/umem: Get rid of per_mm->notifier_count (diff)
downloadlinux-be7a57b41ad824dbc59d1ffa91160ee73f2999ee.tar.xz
linux-be7a57b41ad824dbc59d1ffa91160ee73f2999ee.zip
RDMA/umem: Handle a half-complete start/end sequence
mmu_notifier_unregister() can race between a invalidate_start/end and cause the invalidate_end to be skipped. This causes an imbalance in the locking, which lockdep complains about. This is not actually a bug, as we immediately kfree the memory holding the lock, but it simple enough to fix. Mark when the notifier is being destroyed and abort the start callback. This can be done under the lock we already obtained, and can re-purpose the invalidate_range test we already have. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_umem_odp.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/rdma/ib_umem_odp.h b/include/rdma/ib_umem_odp.h
index ce9502545903..ec05c82ead7a 100644
--- a/include/rdma/ib_umem_odp.h
+++ b/include/rdma/ib_umem_odp.h
@@ -89,6 +89,7 @@ struct ib_ucontext_per_mm {
struct ib_ucontext *context;
struct mm_struct *mm;
struct pid *tgid;
+ bool active;
struct rb_root_cached umem_tree;
/* Protects umem_tree */