linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/srp: Fix completion vector assignment algorithm
@ 2018-02-12 17:50 Bart Van Assche
       [not found] ` <20180212175025.18955-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2018-02-12 17:50 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, Laurence Oberman, linux-rdma, Bart Van Assche,
	Alexander Schmid, stable

Ensure that cv_end is equal to ibdev->num_comp_vectors for the
NUMA node with the highest index. This patch improves spreading
of RDMA channels over completion vectors and thereby improves
performance, especially on systems with only a single NUMA node.
This patch drops support for the comp_vector login parameter by
ignoring the value of that parameter since I have not found a
good way to combine support for that parameter and automatic
spreading of RDMA channels over completion vectors.

Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
Reported-by: Alexander Schmid <alex@modula-shop-systems.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Alexander Schmid <alex@modula-shop-systems.de>
Cc: stable@vger.kernel.org
---
 drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index b48843833d69..241c0e72dce3 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3871,12 +3871,10 @@ static ssize_t srp_create_target(struct device *dev,
 				      num_online_nodes());
 		const int ch_end = ((node_idx + 1) * target->ch_count /
 				    num_online_nodes());
-		const int cv_start = (node_idx * ibdev->num_comp_vectors /
-				      num_online_nodes() + target->comp_vector)
-				     % ibdev->num_comp_vectors;
-		const int cv_end = ((node_idx + 1) * ibdev->num_comp_vectors /
-				    num_online_nodes() + target->comp_vector)
-				   % ibdev->num_comp_vectors;
+		const int cv_start = node_idx * ibdev->num_comp_vectors /
+				     num_online_nodes();
+		const int cv_end = (node_idx + 1) * ibdev->num_comp_vectors /
+				   num_online_nodes();
 		int cpu_idx = 0;
 
 		for_each_online_cpu(cpu) {
-- 
2.16.1

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

* Re: [PATCH] IB/srp: Fix completion vector assignment algorithm
       [not found] ` <20180212175025.18955-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2018-02-15 22:39   ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2018-02-15 22:39 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Doug Ledford, Laurence Oberman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Alexander Schmid, stable-u79uwXL29TY76Z2rM5mHXA

On Mon, Feb 12, 2018 at 09:50:25AM -0800, Bart Van Assche wrote:
> Ensure that cv_end is equal to ibdev->num_comp_vectors for the
> NUMA node with the highest index. This patch improves spreading
> of RDMA channels over completion vectors and thereby improves
> performance, especially on systems with only a single NUMA node.
> This patch drops support for the comp_vector login parameter by
> ignoring the value of that parameter since I have not found a
> good way to combine support for that parameter and automatic
> spreading of RDMA channels over completion vectors.
> 
> Fixes: d92c0da71a35 ("IB/srp: Add multichannel support")
> Reported-by: Alexander Schmid <alex-8Qr8HBQMDtZ/RfFiNYuDoCgLtw5krbHi@public.gmane.org>
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Alexander Schmid <alex-8Qr8HBQMDtZ/RfFiNYuDoCgLtw5krbHi@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>  drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Applied to for-next

Thanks,
Jason
--
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] 2+ messages in thread

end of thread, other threads:[~2018-02-15 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 17:50 [PATCH] IB/srp: Fix completion vector assignment algorithm Bart Van Assche
     [not found] ` <20180212175025.18955-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2018-02-15 22:39   ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).