aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/mlx5_ib.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-10-09 13:09:32 -0300
committerJason Gunthorpe <jgg@mellanox.com>2019-10-28 16:41:14 -0300
commit5256edcb98a14b11409a2d323f56a70a8b366363 (patch)
tree45b6a723c59bc1f7ff6511c266375023b2095732 /drivers/infiniband/hw/mlx5/mlx5_ib.h
parentRDMA/mlx5: Avoid double lookups on the pagefault path (diff)
downloadlinux-dev-5256edcb98a14b11409a2d323f56a70a8b366363.tar.xz
linux-dev-5256edcb98a14b11409a2d323f56a70a8b366363.zip
RDMA/mlx5: Rework implicit ODP destroy
Use SRCU in a sensible way by removing all MRs in the implicit tree from the two xarrays (the update operation), then a synchronize, followed by a normal single threaded teardown. This is only a little unusual from the normal pattern as there can still be some work pending in the unbound wq that may also require a workqueue flush. This is tracked with a single atomic, consolidating the redundant existing atomics and wait queue. For understand-ability the entire ODP implicit create/destroy flow now largely exists in a single pair of functions within odp.c, with a few support functions for tearing down an unused child. Link: https://lore.kernel.org/r/20191009160934.3143-13-jgg@ziepe.ca Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/mlx5_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx5/mlx5_ib.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 88769fcffb5a..b8c958f62628 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -618,10 +618,13 @@ struct mlx5_ib_mr {
u64 pi_iova;
/* For ODP and implicit */
- atomic_t num_leaf_free;
- wait_queue_head_t q_leaf_free;
- atomic_t num_pending_prefetch;
+ atomic_t num_deferred_work;
struct xarray implicit_children;
+ union {
+ struct rcu_head rcu;
+ struct list_head elm;
+ struct work_struct work;
+ } odp_destroy;
struct mlx5_async_work cb_work;
};