Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1211527 > unrolled thread

[PATCH 00/14] RDS: Assorted bug fixes

Started bySantosh Shilimkar <santosh.shilimkar@oracle.com>
First post2015-08-23 00:50 +0200
Last post2015-08-25 22:40 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/14] RDS: Assorted bug fixes Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-23 00:50 +0200
    [PATCH 12/14] RDS: make sure rds_send_drop_to properly takes the m_rs_lock Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-23 00:50 +0200
    [PATCH 01/14] RDS: restore return value in rds_cmsg_rdma_args() Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-23 01:00 +0200
    [PATCH 06/14] RDS: check for congestion updates during rds_send_xmit Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-23 01:00 +0200
    Re: [PATCH 00/14] RDS: Assorted bug fixes David Miller <davem@davemloft.net> - 2015-08-25 22:40 +0200

#1211527 — [PATCH 00/14] RDS: Assorted bug fixes

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2015-08-23 00:50 +0200
Subject[PATCH 00/14] RDS: Assorted bug fixes
Message-ID<q0pLP-7Ac-3@gated-at.bofh.it>
We would like to improve RDS upstream support and in that context, I
started playing with it.  But run into number of issues including as
basic is RDS IB RDMA doesn't work. As part of the debug, I ended up
creating the $subject series which has bunch of assorted fixes. At
least with this series I can run RDS IB RDMA and other tests
successfully.

Some of these fixes have been done by Chris Meson, Andy Grover and
Zach Brown while at Oracle. There are still more kinks with FMR and
error handling and I plan to address them in a follow up series.

Series generated against Linus's master(v4.2-rc-7) but also applies
against next-next cleanly. Its tested on Oracle hardware with IB
fabric for both bcopy as well as RDMA mode. I don't have access
to iWARP hardware so any testing help on iWARP hardware appreciated.

Mukesh Kacker (1):
  RDS: return EMSGSIZE for oversize requests before processing/queueing

Santosh Shilimkar (13):
  RDS: restore return value in rds_cmsg_rdma_args()
  RDS: always free recv frag as we free its ring entry
  RDS: destroy the ib state earlier during shutdown
  RDS: don't update ip address tables if the address hasn't changed
  RDS: make sure we post recv buffers
  RDS: check for congestion updates during rds_send_xmit
  RDS: add a sock_destruct callback debug aid
  RDS: Mark message mapped before transmit
  RDS: Make sure we do a signaled send for large-send
  RDS: Fix assertion level from fatal to warning
  RDS: Don't destroy the rdma id until after we're done using it
  RDS: make sure rds_send_drop_to properly takes the m_rs_lock
  RDS: check for valid cm_id before initiating connection

 net/rds/af_rds.c         |  9 ++++++
 net/rds/connection.c     |  2 ++
 net/rds/ib.h             |  2 +-
 net/rds/ib_cm.c          | 17 +++++++-----
 net/rds/ib_rdma.c        | 11 ++++++--
 net/rds/ib_recv.c        | 71 ++++++++++++++++++++++++++++++++++++++++++------
 net/rds/ib_send.c        |  5 ++++
 net/rds/rdma.c           |  4 ++-
 net/rds/rdma_transport.c | 15 ++++++++--
 net/rds/rds.h            |  1 +
 net/rds/send.c           | 54 ++++++++++++++++++++++++++----------
 11 files changed, 153 insertions(+), 38 deletions(-)


Regards,
Santosh
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1211528 — [PATCH 12/14] RDS: make sure rds_send_drop_to properly takes the m_rs_lock

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2015-08-23 00:50 +0200
Subject[PATCH 12/14] RDS: make sure rds_send_drop_to properly takes the m_rs_lock
Message-ID<q0pLR-7Ac-31@gated-at.bofh.it>
In reply to#1211527
rds_send_drop_to() is used during socket tear down to find all the
messages on the socket and flush them .  It can race with the
acking code unless it takes the m_rs_lock on each and every message.

This plugs a hole where we didn't take m_rs_lock on any message that
didn't have the RDS_MSG_ON_CONN set.  Taking m_rs_lock avoids
double frees and other memory corruptions as the ack code trusts
the message m_rs pointer on a socket that had actually been freed.

We must take m_rs_lock to access m_rs.  Because of lock nesting and
rs access, we also need to acquire rs_lock.

Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/send.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index 96ae38d..b0fe412 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -778,8 +778,22 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
 	while (!list_empty(&list)) {
 		rm = list_entry(list.next, struct rds_message, m_sock_item);
 		list_del_init(&rm->m_sock_item);
-
 		rds_message_wait(rm);
+
+		/* just in case the code above skipped this message
+		 * because RDS_MSG_ON_CONN wasn't set, run it again here
+		 * taking m_rs_lock is the only thing that keeps us
+		 * from racing with ack processing.
+		 */
+		spin_lock_irqsave(&rm->m_rs_lock, flags);
+
+		spin_lock(&rs->rs_lock);
+		__rds_send_complete(rs, rm, RDS_RDMA_CANCELED);
+		spin_unlock(&rs->rs_lock);
+
+		rm->m_rs = NULL;
+		spin_unlock_irqrestore(&rm->m_rs_lock, flags);
+
 		rds_message_put(rm);
 	}
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1211529 — [PATCH 01/14] RDS: restore return value in rds_cmsg_rdma_args()

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2015-08-23 01:00 +0200
Subject[PATCH 01/14] RDS: restore return value in rds_cmsg_rdma_args()
Message-ID<q0pVv-7MN-1@gated-at.bofh.it>
In reply to#1211527
In rds_cmsg_rdma_args() 'ret' is used by rds_pin_pages() which returns
number of pinned pages on success. And the same value is returned to the
caller of rds_cmsg_rdma_args() on success which is not intended.

Commit f4a3fc03c1d7 ("RDS: Clean up error handling in rds_cmsg_rdma_args")
removed the 'ret = 0' line which broke RDS RDMA mode.

Fix it by restoring the return value on rds_pin_pages() success
keeping the clean-up in place.

Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index 40084d8..6401b50 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -658,6 +658,8 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
 		ret = rds_pin_pages(iov->addr, nr, pages, !op->op_write);
 		if (ret < 0)
 			goto out;
+		else
+			ret = 0;
 
 		rdsdebug("RDS: nr_bytes %u nr %u iov->bytes %llu iov->addr %llx\n",
 			 nr_bytes, nr, iov->bytes, iov->addr);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1211530 — [PATCH 06/14] RDS: check for congestion updates during rds_send_xmit

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2015-08-23 01:00 +0200
Subject[PATCH 06/14] RDS: check for congestion updates during rds_send_xmit
Message-ID<q0pVw-7MN-15@gated-at.bofh.it>
In reply to#1211527
Ensure we don't keep sending the data if the link is congested.

Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/send.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index e9430f5..dbdf907 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -411,7 +411,8 @@ over_batch:
 	 */
 	if (ret == 0) {
 		smp_mb();
-		if (!list_empty(&conn->c_send_queue) &&
+		if ((test_bit(0, &conn->c_map_queued) ||
+		     !list_empty(&conn->c_send_queue)) &&
 		    send_gen == conn->c_send_gen) {
 			rds_stats_inc(s_send_lock_queue_raced);
 			goto restart;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1213325

FromDavid Miller <davem@davemloft.net>
Date2015-08-25 22:40 +0200
Message-ID<q1taG-He-25@gated-at.bofh.it>
In reply to#1211527
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Date: Sat, 22 Aug 2015 15:45:21 -0700

> We would like to improve RDS upstream support and in that context, I
> started playing with it.  But run into number of issues including as
> basic is RDS IB RDMA doesn't work. As part of the debug, I ended up
> creating the $subject series which has bunch of assorted fixes. At
> least with this series I can run RDS IB RDMA and other tests
> successfully.
> 
> Some of these fixes have been done by Chris Meson, Andy Grover and
> Zach Brown while at Oracle. There are still more kinks with FMR and
> error handling and I plan to address them in a follow up series.
> 
> Series generated against Linus's master(v4.2-rc-7) but also applies
> against next-next cleanly. Its tested on Oracle hardware with IB
> fabric for both bcopy as well as RDMA mode. I don't have access
> to iWARP hardware so any testing help on iWARP hardware appreciated.

Series applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web