aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_verbs.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-09-16 20:48:07 +0300
committerDoug Ledford <dledford@redhat.com>2018-09-21 11:54:46 -0400
commitc9990ab39b6e911003bab10a6da96e98ab1503a3 (patch)
tree9a58cb3f9c74089b3e022d5dc89d808f8bf9bb2c /include/rdma/ib_verbs.h
parentRDMA/umem: Get rid of struct ib_umem.odp_data (diff)
downloadlinux-dev-c9990ab39b6e911003bab10a6da96e98ab1503a3.tar.xz
linux-dev-c9990ab39b6e911003bab10a6da96e98ab1503a3.zip
RDMA/umem: Move all the ODP related stuff out of ucontext and into per_mm
This is the first step to make ODP use the owning_mm that is now part of struct ib_umem. Each ODP umem is linked to a single per_mm structure, which in turn, is linked to a single mm, via the embedded mmu_notifier. This first patch introduces the structure and reworks eveything to use it. This also needs to introduce tgid into the ib_ucontext_per_mm, as get_user_pages_remote() requires the originating task for statistics tracking. 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 '')
-rw-r--r--include/rdma/ib_verbs.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index d611ce9df7fb..2cf2cee5a753 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1488,6 +1488,25 @@ struct ib_rdmacg_object {
#endif
};
+#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
+struct ib_ucontext_per_mm {
+ struct ib_ucontext *context;
+
+ struct rb_root_cached umem_tree;
+ /*
+ * Protects .umem_rbroot and tree, as well as odp_mrs_count and
+ * mmu notifiers registration.
+ */
+ struct rw_semaphore umem_rwsem;
+
+ struct mmu_notifier mn;
+ atomic_t notifier_count;
+ /* A list of umems that don't have private mmu notifier counters yet. */
+ struct list_head no_private_counters;
+ unsigned int odp_mrs_count;
+};
+#endif
+
struct ib_ucontext {
struct ib_device *device;
struct ib_uverbs_file *ufile;
@@ -1502,20 +1521,9 @@ struct ib_ucontext {
struct pid *tgid;
#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
- struct rb_root_cached umem_tree;
- /*
- * Protects .umem_rbroot and tree, as well as odp_mrs_count and
- * mmu notifiers registration.
- */
- struct rw_semaphore umem_rwsem;
void (*invalidate_range)(struct ib_umem_odp *umem_odp,
unsigned long start, unsigned long end);
-
- struct mmu_notifier mn;
- atomic_t notifier_count;
- /* A list of umems that don't have private mmu notifier counters yet. */
- struct list_head no_private_counters;
- int odp_mrs_count;
+ struct ib_ucontext_per_mm per_mm;
#endif
struct ib_rdmacg_object cg_obj;