public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] On-demand paging minor fixes
@ 2015-01-06 11:56 Haggai Eran
       [not found] ` <1420545362-18571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Haggai Eran @ 2015-01-06 11:56 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Majd Dibbiny,
	Shachar Raindel, Haggai Eran

Hi Roland,

I've updated these patches' commit message and subject lines with some style
changed following comments from Or Gerlitz. They contain fixes for 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):
  IB/mlx5: 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] 4+ messages in thread

* [PATCH v1 1/2] IB/mlx5: Update the dev in reg_create
       [not found] ` <1420545362-18571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-01-06 11:56   ` Haggai Eran
  2015-01-06 11:56   ` [PATCH v1 2/2] IB/core: Properly handle registration of on-demand paging MRs after dereg Haggai Eran
  2015-02-08 12:15   ` [PATCH v1 0/2] On-demand paging minor fixes Haggai Eran
  2 siblings, 0 replies; 4+ messages in thread
From: Haggai Eran @ 2015-01-06 11:56 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Majd Dibbiny,
	Shachar Raindel, Haggai Eran

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

When we create an MR using reg_create, the mlx5_ib_dev pointer is not
updated on the new MR. This results in a kernel panics for ODP MRs while
handling page faults, when the mlx5_ib_update_mtt function uses the
invalid device pointer.

Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
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] 4+ messages in thread

* [PATCH v1 2/2] IB/core: Properly handle registration of on-demand paging MRs after dereg
       [not found] ` <1420545362-18571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-01-06 11:56   ` [PATCH v1 1/2] IB/mlx5: Update the dev in reg_create Haggai Eran
@ 2015-01-06 11:56   ` Haggai Eran
  2015-02-08 12:15   ` [PATCH v1 0/2] On-demand paging minor fixes Haggai Eran
  2 siblings, 0 replies; 4+ messages in thread
From: Haggai Eran @ 2015-01-06 11:56 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Majd Dibbiny,
	Shachar Raindel, Haggai Eran

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] 4+ messages in thread

* Re: [PATCH v1 0/2] On-demand paging minor fixes
       [not found] ` <1420545362-18571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-01-06 11:56   ` [PATCH v1 1/2] IB/mlx5: Update the dev in reg_create Haggai Eran
  2015-01-06 11:56   ` [PATCH v1 2/2] IB/core: Properly handle registration of on-demand paging MRs after dereg Haggai Eran
@ 2015-02-08 12:15   ` Haggai Eran
  2 siblings, 0 replies; 4+ messages in thread
From: Haggai Eran @ 2015-02-08 12:15 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Majd Dibbiny,
	Shachar Raindel

Hi Roland,

On 06/01/2015 13:56, Haggai Eran wrote:
> I've updated these patches' commit message and subject lines with some style
> changed following comments from Or Gerlitz. They contain fixes for minor issues
> with the on-demand paging patchset. I hope you can accept them for v3.19-rc4.

Could you take these minor ODP fixes into v3.20?

The patches were archived at:
  http://marc.info/?l=linux-rdma&m=142054539427218

Thanks,
Haggai



--
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] 4+ messages in thread

end of thread, other threads:[~2015-02-08 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06 11:56 [PATCH v1 0/2] On-demand paging minor fixes Haggai Eran
     [not found] ` <1420545362-18571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-01-06 11:56   ` [PATCH v1 1/2] IB/mlx5: Update the dev in reg_create Haggai Eran
2015-01-06 11:56   ` [PATCH v1 2/2] IB/core: Properly handle registration of on-demand paging MRs after dereg Haggai Eran
2015-02-08 12:15   ` [PATCH v1 0/2] On-demand paging minor fixes Haggai Eran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox