aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtemy Kovalyov <[email protected]>2017-04-05 09:23:53 +0300
committerDoug Ledford <[email protected]>2017-04-25 15:40:28 -0400
commit523791d7c5eb4533ded3ba3de3517431243c0de5 (patch)
tree7853d0f1473b9f7f236a1692c6e397b68ae95491
parent438b228e03740957d94198417d28a6ebea6672ed (diff)
IB/mlx5: Fix implicit MR GC
When implicit MR's leaf MKey becomes unused, i.e. when it's last page being released my MMU invalidation it is marked as "dying" and scheduled for release by garbage collector. Currentle consequent page fault may remove "dying" flag. Treat leaf MKey as non-existent once it was scheduled to removal by GC. Fixes: 81713d3788d2 ('IB/mlx5: Add implicit MR support') Signed-off-by: Artemy Kovalyov <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
-rw-r--r--drivers/infiniband/hw/mlx5/odp.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index 3bfa3a9c3be0..b506321f5cb7 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -57,7 +57,7 @@ static int check_parent(struct ib_umem_odp *odp,
{
struct mlx5_ib_mr *mr = odp->private;
- return mr && mr->parent == parent;
+ return mr && mr->parent == parent && !odp->dying;
}
static struct ib_umem_odp *odp_next(struct ib_umem_odp *odp)
@@ -158,13 +158,6 @@ static void mr_leaf_free_action(struct work_struct *work)
mr->parent = NULL;
synchronize_srcu(&mr->dev->mr_srcu);
- if (!READ_ONCE(odp->dying)) {
- mr->parent = imr;
- if (atomic_dec_and_test(&imr->num_leaf_free))
- wake_up(&imr->q_leaf_free);
- return;
- }
-
ib_umem_release(odp->umem);
if (imr->live)
mlx5_ib_update_xlt(imr, idx, 1, 0,
@@ -436,8 +429,6 @@ next_mr:
nentries++;
}
- odp->dying = 0;
-
/* Return first odp if region not covered by single one */
if (likely(!result))
result = odp;