All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] on-demand paging minor fixes
@ 2015-01-06  9:23 Haggai Eran
       [not found] ` <1420536200-5705-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Haggai Eran @ 2015-01-06  9:23 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Haggai Eran, Or Gerlitz,
	Majd Dibbiny, Shachar Raindel

Hi Roland,

Here are a couple of patches fixing some minor issues with the on-demand paging
patchset. I hope you can accept them for v3.19-rc4.

Regards,
Haggai

Haggai Eran (1):
  IB/core: properly handle registration of on-demand paging MRs after
    dereg

Majd Dibbiny (1):
  mlx5_ib: update the dev in reg_create

 drivers/infiniband/core/umem_odp.c | 3 ++-
 drivers/infiniband/hw/mlx5/mr.c    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] mlx5_ib: update the dev in reg_create
       [not found] ` <1420536200-5705-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-01-06  9:23   ` Haggai Eran
  2015-01-06  9:23   ` [PATCH 2/2] IB/core: properly handle registration of on-demand paging MRs after dereg Haggai Eran
  1 sibling, 0 replies; 3+ messages in thread
From: Haggai Eran @ 2015-01-06  9:23 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Haggai Eran, Or Gerlitz,
	Majd Dibbiny, Shachar Raindel

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

When we create an MR using reg_create, the mlx5_ib_dev was not updated on
the new MR. This results in a kernel panics for ODP MRs while handling page
faults.

Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org rebased to v3.19-rc3]
Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/mr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 32a28bd50b20..cd9822eeacae 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -1012,6 +1012,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, u64 virt_addr,
 		goto err_2;
 	}
 	mr->umem = umem;
+	mr->dev = dev;
 	mr->live = 1;
 	kvfree(in);
 
-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] IB/core: properly handle registration of on-demand paging MRs after dereg
       [not found] ` <1420536200-5705-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-01-06  9:23   ` [PATCH 1/2] mlx5_ib: update the dev in reg_create Haggai Eran
@ 2015-01-06  9:23   ` Haggai Eran
  1 sibling, 0 replies; 3+ messages in thread
From: Haggai Eran @ 2015-01-06  9:23 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Haggai Eran, Or Gerlitz,
	Majd Dibbiny, Shachar Raindel

When the last on-demand paging MR is released the notifier count is left
non-zero so that concurrent page faults will have to abort. If a new MR
is then registered, the counter is reset. However, the decision is made
to put the new MR in the list waiting for the notifier count to reach
zero, before the counter is reset. An invalidation or another MR
registration can release the MR to handle page faults, but without such
an event the MR can wait forever.

The patch fixes this issue by adding a check whether the MR is the first
on-demand paging MR when deciding whether it is ready to handle page
faults. If it is the first MR, we know that there are no mmu notifiers
running in parallel to the registration.

Fixes: 882214e2b128 ("IB/core: Implement support for MMU notifiers regarding on demand paging regions")
Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/umem_odp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index 6095872549e7..8b8cc6fa0ab0 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -294,7 +294,8 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem)
 	if (likely(ib_umem_start(umem) != ib_umem_end(umem)))
 		rbt_ib_umem_insert(&umem->odp_data->interval_tree,
 				   &context->umem_tree);
-	if (likely(!atomic_read(&context->notifier_count)))
+	if (likely(!atomic_read(&context->notifier_count)) ||
+	    context->odp_mrs_count == 1)
 		umem->odp_data->mn_counters_active = true;
 	else
 		list_add(&umem->odp_data->no_private_counters,
-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-06  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-06  9:23 [PATCH 0/2] on-demand paging minor fixes Haggai Eran
     [not found] ` <1420536200-5705-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-01-06  9:23   ` [PATCH 1/2] mlx5_ib: update the dev in reg_create Haggai Eran
2015-01-06  9:23   ` [PATCH 2/2] IB/core: properly handle registration of on-demand paging MRs after dereg Haggai Eran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.