netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/12] RDS: updates for net-next
@ 2009-04-10  0:09 Andy Grover
  2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel

Hi Dave, this is a series of noncritical rds updates for net-next.
Shortlog follows.

Regards -- Andy

Andy Grover (4):
      RDS: Correct some iw references in rdma_transport.c
      RDS: Fix ordering in a conditional
      RDS: Establish connection before parsing CMSGs
      RDS: use get_user_pages_fast()

Dan Carpenter (2):
      ERR_PTR() dereference in net/rds/iw.c
      ERR_PTR() dereference in net/rds/ib.c

Huang Weiyi (1):
      RDS: remove unused #include <version.h>

Kyle McMartin (1):
      MAINTAINERS: rds list is moderated

Steve Wise (3):
      RDS/IW+IB: Set recv ring low water mark to 1/2 full.
      RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled.
      RDS/IW+IB: Allow max credit advertise window.

Wei Yongjun (1):
      rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset




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

* [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full.
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c Andy Grover
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Steve Wise

From: Steve Wise <swise@opengridcomputing.com>

Currently the recv ring low water mark is 1/4 the depth.  Performance
measurements show that this limits iWARP throughput by flow controlling
the rds-stress senders.  Setting it to 1/2 seems to max the T3
performance.  I tried even higher levels but that didn't help and it
started to increase the rds thread cpu utilization.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/ib_ring.c |    2 +-
 net/rds/iw_ring.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/ib_ring.c b/net/rds/ib_ring.c
index 99a6cca..ff97e8e 100644
--- a/net/rds/ib_ring.c
+++ b/net/rds/ib_ring.c
@@ -137,7 +137,7 @@ int rds_ib_ring_empty(struct rds_ib_work_ring *ring)
 
 int rds_ib_ring_low(struct rds_ib_work_ring *ring)
 {
-	return __rds_ib_ring_used(ring) <= (ring->w_nr >> 2);
+	return __rds_ib_ring_used(ring) <= (ring->w_nr >> 1);
 }
 
 /*
diff --git a/net/rds/iw_ring.c b/net/rds/iw_ring.c
index d422d4b..da8e3b6 100644
--- a/net/rds/iw_ring.c
+++ b/net/rds/iw_ring.c
@@ -137,7 +137,7 @@ int rds_iw_ring_empty(struct rds_iw_work_ring *ring)
 
 int rds_iw_ring_low(struct rds_iw_work_ring *ring)
 {
-	return __rds_iw_ring_used(ring) <= (ring->w_nr >> 2);
+	return __rds_iw_ring_used(ring) <= (ring->w_nr >> 1);
 }
 
 
-- 
1.5.6.3


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

* [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
  2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled Andy Grover
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel

Had some lingering instances of _iw_ variable names from when
the listen code was centralized into rdma_transport.c

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/rdma_transport.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 7b19024..7d0f901 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -34,7 +34,7 @@
 
 #include "rdma_transport.h"
 
-static struct rdma_cm_id *rds_iw_listen_id;
+static struct rdma_cm_id *rds_rdma_listen_id;
 
 int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
 			      struct rdma_cm_event *event)
@@ -161,7 +161,7 @@ static int __init rds_rdma_listen_init(void)
 
 	rdsdebug("cm %p listening on port %u\n", cm_id, RDS_PORT);
 
-	rds_iw_listen_id = cm_id;
+	rds_rdma_listen_id = cm_id;
 	cm_id = NULL;
 out:
 	if (cm_id)
@@ -171,10 +171,10 @@ out:
 
 static void rds_rdma_listen_stop(void)
 {
-	if (rds_iw_listen_id) {
-		rdsdebug("cm %p\n", rds_iw_listen_id);
-		rdma_destroy_id(rds_iw_listen_id);
-		rds_iw_listen_id = NULL;
+	if (rds_rdma_listen_id) {
+		rdsdebug("cm %p\n", rds_rdma_listen_id);
+		rdma_destroy_id(rds_rdma_listen_id);
+		rds_rdma_listen_id = NULL;
 	}
 }
 
-- 
1.5.6.3


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

* [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled.
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
  2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
  2009-04-10  0:09 ` [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window Andy Grover
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Steve Wise

From: Steve Wise <swise@opengridcomputing.com>

The RDS_LL_SEND_FULL bit should be set when we stop transmitted due to
flow control.  Otherwise the send worker will keep trying as opposed to
sleeping until we unthrottle.  Saves CPU.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/ib_send.c |    2 +-
 net/rds/iw_send.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index cb6c52c..fa684b7 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -506,7 +506,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
 			flow_controlled++;
 		}
 		if (work_alloc == 0) {
-			rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
+			set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
 			rds_ib_stats_inc(s_ib_tx_throttle);
 			ret = -ENOMEM;
 			goto out;
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index 22dd38f..626290b 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -549,7 +549,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
 			flow_controlled++;
 		}
 		if (work_alloc == 0) {
-			rds_iw_ring_unalloc(&ic->i_send_ring, work_alloc);
+			set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
 			rds_iw_stats_inc(s_iw_tx_throttle);
 			ret = -ENOMEM;
 			goto out;
-- 
1.5.6.3


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

* [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window.
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (2 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 05/12] RDS: Fix ordering in a conditional Andy Grover
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Steve Wise

From: Steve Wise <swise@opengridcomputing.com>

Fix hack that restricts the credit advertisement to 127.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/ib.h      |    2 +-
 net/rds/ib_recv.c |    2 +-
 net/rds/ib_send.c |    8 ++++----
 net/rds/iw.h      |    2 +-
 net/rds/iw_recv.c |    2 +-
 net/rds/iw_send.c |    8 ++++----
 net/rds/rds.h     |    2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/net/rds/ib.h b/net/rds/ib.h
index 069206c..455ae73 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -333,7 +333,7 @@ int rds_ib_xmit_rdma(struct rds_connection *conn, struct rds_rdma_op *op);
 void rds_ib_send_add_credits(struct rds_connection *conn, unsigned int credits);
 void rds_ib_advertise_credits(struct rds_connection *conn, unsigned int posted);
 int rds_ib_send_grab_credits(struct rds_ib_connection *ic, u32 wanted,
-			     u32 *adv_credits, int need_posted);
+			     u32 *adv_credits, int need_posted, int max_posted);
 
 /* ib_stats.c */
 DECLARE_PER_CPU(struct rds_ib_statistics, rds_ib_stats);
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 36d9315..5709bad 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -524,7 +524,7 @@ void rds_ib_attempt_ack(struct rds_ib_connection *ic)
 	}
 
 	/* Can we get a send credit? */
-	if (!rds_ib_send_grab_credits(ic, 1, &adv_credits, 0)) {
+	if (!rds_ib_send_grab_credits(ic, 1, &adv_credits, 0, RDS_MAX_ADV_CREDIT)) {
 		rds_ib_stats_inc(s_ib_tx_throttle);
 		clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
 		return;
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index fa684b7..23bf830 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -311,7 +311,7 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
  * and using atomic_cmpxchg when updating the two counters.
  */
 int rds_ib_send_grab_credits(struct rds_ib_connection *ic,
-			     u32 wanted, u32 *adv_credits, int need_posted)
+			     u32 wanted, u32 *adv_credits, int need_posted, int max_posted)
 {
 	unsigned int avail, posted, got = 0, advertise;
 	long oldval, newval;
@@ -351,7 +351,7 @@ try_again:
 	 * available.
 	 */
 	if (posted && (got || need_posted)) {
-		advertise = min_t(unsigned int, posted, RDS_MAX_ADV_CREDIT);
+		advertise = min_t(unsigned int, posted, max_posted);
 		newval -= IB_SET_POST_CREDITS(advertise);
 	}
 
@@ -498,7 +498,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
 
 	credit_alloc = work_alloc;
 	if (ic->i_flowctl) {
-		credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &posted, 0);
+		credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &posted, 0, RDS_MAX_ADV_CREDIT);
 		adv_credits += posted;
 		if (credit_alloc < work_alloc) {
 			rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
@@ -571,7 +571,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
 		/*
 		 * Update adv_credits since we reset the ACK_REQUIRED bit.
 		 */
-		rds_ib_send_grab_credits(ic, 0, &posted, 1);
+		rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
 		adv_credits += posted;
 		BUG_ON(adv_credits > 255);
 	} else if (ic->i_rm != rm)
diff --git a/net/rds/iw.h b/net/rds/iw.h
index b4fb272..0715dde 100644
--- a/net/rds/iw.h
+++ b/net/rds/iw.h
@@ -361,7 +361,7 @@ int rds_iw_xmit_rdma(struct rds_connection *conn, struct rds_rdma_op *op);
 void rds_iw_send_add_credits(struct rds_connection *conn, unsigned int credits);
 void rds_iw_advertise_credits(struct rds_connection *conn, unsigned int posted);
 int rds_iw_send_grab_credits(struct rds_iw_connection *ic, u32 wanted,
-			     u32 *adv_credits, int need_posted);
+			     u32 *adv_credits, int need_posted, int max_posted);
 
 /* ib_stats.c */
 DECLARE_PER_CPU(struct rds_iw_statistics, rds_iw_stats);
diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c
index fde470f..8683f5f 100644
--- a/net/rds/iw_recv.c
+++ b/net/rds/iw_recv.c
@@ -524,7 +524,7 @@ void rds_iw_attempt_ack(struct rds_iw_connection *ic)
 	}
 
 	/* Can we get a send credit? */
-	if (!rds_iw_send_grab_credits(ic, 1, &adv_credits, 0)) {
+	if (!rds_iw_send_grab_credits(ic, 1, &adv_credits, 0, RDS_MAX_ADV_CREDIT)) {
 		rds_iw_stats_inc(s_iw_tx_throttle);
 		clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
 		return;
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index 626290b..44a6a05 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -347,7 +347,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
  * and using atomic_cmpxchg when updating the two counters.
  */
 int rds_iw_send_grab_credits(struct rds_iw_connection *ic,
-			     u32 wanted, u32 *adv_credits, int need_posted)
+			     u32 wanted, u32 *adv_credits, int need_posted, int max_posted)
 {
 	unsigned int avail, posted, got = 0, advertise;
 	long oldval, newval;
@@ -387,7 +387,7 @@ try_again:
 	 * available.
 	 */
 	if (posted && (got || need_posted)) {
-		advertise = min_t(unsigned int, posted, RDS_MAX_ADV_CREDIT);
+		advertise = min_t(unsigned int, posted, max_posted);
 		newval -= IB_SET_POST_CREDITS(advertise);
 	}
 
@@ -541,7 +541,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
 
 	credit_alloc = work_alloc;
 	if (ic->i_flowctl) {
-		credit_alloc = rds_iw_send_grab_credits(ic, work_alloc, &posted, 0);
+		credit_alloc = rds_iw_send_grab_credits(ic, work_alloc, &posted, 0, RDS_MAX_ADV_CREDIT);
 		adv_credits += posted;
 		if (credit_alloc < work_alloc) {
 			rds_iw_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
@@ -614,7 +614,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
 		/*
 		 * Update adv_credits since we reset the ACK_REQUIRED bit.
 		 */
-		rds_iw_send_grab_credits(ic, 0, &posted, 1);
+		rds_iw_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
 		adv_credits += posted;
 		BUG_ON(adv_credits > 255);
 	} else if (ic->i_rm != rm)
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 619f0a3..1f82ec0 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -132,7 +132,7 @@ struct rds_connection {
 #define RDS_FLAG_CONG_BITMAP	0x01
 #define RDS_FLAG_ACK_REQUIRED	0x02
 #define RDS_FLAG_RETRANSMITTED	0x04
-#define RDS_MAX_ADV_CREDIT	127
+#define RDS_MAX_ADV_CREDIT	255
 
 /*
  * Maximum space available for extension headers.
-- 
1.5.6.3


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

* [PATCH 05/12] RDS: Fix ordering in a conditional
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (3 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 06/12] RDS: Establish connection before parsing CMSGs Andy Grover
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel

Putting the constant first is a supposed "best practice" that actually makes
the code harder to read.

Thanks to Roland Dreier for finding a bug in this "simple, obviously correct"
patch.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/rdma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index eaeeb91..e390dc7 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -155,7 +155,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
 			     nr_pages, write, 0, pages, NULL);
 	up_read(&current->mm->mmap_sem);
 
-	if (0 <= ret && (unsigned) ret < nr_pages) {
+	if (ret >= 0 && ret < nr_pages) {
 		while (ret--)
 			put_page(pages[ret]);
 		ret = -EFAULT;
-- 
1.5.6.3


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

* [PATCH 06/12] RDS: Establish connection before parsing CMSGs
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (4 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 05/12] RDS: Fix ordering in a conditional Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 07/12] RDS: use get_user_pages_fast() Andy Grover
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel

The first message to a remote node should prompt a new connection.
Even an RDMA op via CMSG. Therefore move CMSG parsing to after
connection establishment.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/send.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index 104fe03..a4a7f42 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -854,11 +854,6 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
 
 	rm->m_daddr = daddr;
 
-	/* Parse any control messages the user may have included. */
-	ret = rds_cmsg_send(rs, rm, msg, &allocated_mr);
-	if (ret)
-		goto out;
-
 	/* rds_conn_create has a spinlock that runs with IRQ off.
 	 * Caching the conn in the socket helps a lot. */
 	if (rs->rs_conn && rs->rs_conn->c_faddr == daddr)
@@ -874,6 +869,11 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
 		rs->rs_conn = conn;
 	}
 
+	/* Parse any control messages the user may have included. */
+	ret = rds_cmsg_send(rs, rm, msg, &allocated_mr);
+	if (ret)
+		goto out;
+
 	if ((rm->m_rdma_cookie || rm->m_rdma_op)
 	 && conn->c_trans->xmit_rdma == NULL) {
 		if (printk_ratelimit())
-- 
1.5.6.3


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

* [PATCH 07/12] RDS: use get_user_pages_fast()
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (5 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 06/12] RDS: Establish connection before parsing CMSGs Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 08/12] RDS: remove unused #include <version.h> Andy Grover
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel

Use the new function that is simpler and faster.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/info.c |    5 +----
 net/rds/rdma.c |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/net/rds/info.c b/net/rds/info.c
index 1d88553..62aeef3 100644
--- a/net/rds/info.c
+++ b/net/rds/info.c
@@ -188,10 +188,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
 		ret = -ENOMEM;
 		goto out;
 	}
-	down_read(&current->mm->mmap_sem);
-	ret = get_user_pages(current, current->mm, start, nr_pages, 1, 0,
-			     pages, NULL);
-	up_read(&current->mm->mmap_sem);
+	ret = get_user_pages_fast(start, nr_pages, 1, pages);
 	if (ret != nr_pages) {
 		if (ret > 0)
 			nr_pages = ret;
diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index e390dc7..8dc83d2 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -150,10 +150,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
 {
 	int ret;
 
-	down_read(&current->mm->mmap_sem);
-	ret = get_user_pages(current, current->mm, user_addr,
-			     nr_pages, write, 0, pages, NULL);
-	up_read(&current->mm->mmap_sem);
+	ret = get_user_pages_fast(user_addr, nr_pages, write, pages);
 
 	if (ret >= 0 && ret < nr_pages) {
 		while (ret--)
-- 
1.5.6.3


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

* [PATCH 08/12] RDS: remove unused #include <version.h>
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (6 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 07/12] RDS: use get_user_pages_fast() Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Andy Grover
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Huang Weiyi

From: Huang Weiyi <weiyi.huang@gmail.com>

Remove unused #include <version.h> in net/rds/af_rds.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/af_rds.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 20cf16f..b11e7e5 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -35,7 +35,6 @@
 #include <linux/kernel.h>
 #include <linux/in.h>
 #include <linux/poll.h>
-#include <linux/version.h>
 #include <net/sock.h>
 
 #include "rds.h"
-- 
1.5.6.3


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

* [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (7 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 08/12] RDS: remove unused #include <version.h> Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c Andy Grover
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Wei Yongjun

From: Wei Yongjun <yjwei@cn.fujitsu.com>

Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/connection.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/rds/connection.c b/net/rds/connection.c
index 273f064..d14445c 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -148,14 +148,12 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
 	if (conn)
 		goto out;
 
-	conn = kmem_cache_alloc(rds_conn_slab, gfp);
+	conn = kmem_cache_zalloc(rds_conn_slab, gfp);
 	if (conn == NULL) {
 		conn = ERR_PTR(-ENOMEM);
 		goto out;
 	}
 
-	memset(conn, 0, sizeof(*conn));
-
 	INIT_HLIST_NODE(&conn->c_hash_node);
 	conn->c_version = RDS_PROTOCOL_3_0;
 	conn->c_laddr = laddr;
-- 
1.5.6.3


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

* [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (8 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c Andy Grover
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Dan Carpenter

From: Dan Carpenter <error27@gmail.com>

rdma_create_id() returns ERR_PTR() not null.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/iw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/iw.c b/net/rds/iw.c
index b732efb..d16e1cb 100644
--- a/net/rds/iw.c
+++ b/net/rds/iw.c
@@ -233,8 +233,8 @@ static int rds_iw_laddr_check(__be32 addr)
 	 * IB and iWARP capable NICs.
 	 */
 	cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
-	if (!cm_id)
-		return -EADDRNOTAVAIL;
+	if (IS_ERR(cm_id))
+		return PTR_ERR(cm_id);
 
 	memset(&sin, 0, sizeof(sin));
 	sin.sin_family = AF_INET;
-- 
1.5.6.3


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

* [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (9 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:09 ` [PATCH 12/12] MAINTAINERS: rds list is moderated Andy Grover
  2009-04-10  0:21 ` [PATCH net-next 0/12] RDS: updates for net-next David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Dan Carpenter

From: Dan Carpenter <error27@gmail.com>

rdma_create_id() doesn't return NULL, only ERR_PTR().

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/ib.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/ib.c b/net/rds/ib.c
index 4933b38..b9bcd32 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -224,8 +224,8 @@ static int rds_ib_laddr_check(__be32 addr)
 	 * IB and iWARP capable NICs.
 	 */
 	cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
-	if (!cm_id)
-		return -EADDRNOTAVAIL;
+	if (IS_ERR(cm_id))
+		return PTR_ERR(cm_id);
 
 	memset(&sin, 0, sizeof(sin));
 	sin.sin_family = AF_INET;
-- 
1.5.6.3


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

* [PATCH 12/12] MAINTAINERS: rds list is moderated
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (10 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c Andy Grover
@ 2009-04-10  0:09 ` Andy Grover
  2009-04-10  0:21 ` [PATCH net-next 0/12] RDS: updates for net-next David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: Andy Grover @ 2009-04-10  0:09 UTC (permalink / raw)
  To: netdev; +Cc: rds-devel, Kyle McMartin

From: Kyle McMartin <kyle@redhat.com>

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c3b2159..28421c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3729,7 +3729,7 @@ S:	Maintained
 RDS - RELIABLE DATAGRAM SOCKETS
 P:	Andy Grover
 M:	andy.grover@oracle.com
-L:	rds-devel@oss.oracle.com
+L:	rds-devel@oss.oracle.com (moderated for non-subscribers)
 S:	Supported
 
 READ-COPY UPDATE (RCU)
-- 
1.5.6.3


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

* Re: [PATCH net-next 0/12] RDS: updates for net-next
  2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
                   ` (11 preceding siblings ...)
  2009-04-10  0:09 ` [PATCH 12/12] MAINTAINERS: rds list is moderated Andy Grover
@ 2009-04-10  0:21 ` David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: David Miller @ 2009-04-10  0:21 UTC (permalink / raw)
  To: andy.grover; +Cc: netdev, rds-devel

From: Andy Grover <andy.grover@oracle.com>
Date: Thu,  9 Apr 2009 17:09:35 -0700

> Hi Dave, this is a series of noncritical rds updates for net-next.
> Shortlog follows.

All applied, thanks Andy.

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

end of thread, other threads:[~2009-04-10  0:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
2009-04-10  0:09 ` [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c Andy Grover
2009-04-10  0:09 ` [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled Andy Grover
2009-04-10  0:09 ` [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window Andy Grover
2009-04-10  0:09 ` [PATCH 05/12] RDS: Fix ordering in a conditional Andy Grover
2009-04-10  0:09 ` [PATCH 06/12] RDS: Establish connection before parsing CMSGs Andy Grover
2009-04-10  0:09 ` [PATCH 07/12] RDS: use get_user_pages_fast() Andy Grover
2009-04-10  0:09 ` [PATCH 08/12] RDS: remove unused #include <version.h> Andy Grover
2009-04-10  0:09 ` [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Andy Grover
2009-04-10  0:09 ` [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c Andy Grover
2009-04-10  0:09 ` [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c Andy Grover
2009-04-10  0:09 ` [PATCH 12/12] MAINTAINERS: rds list is moderated Andy Grover
2009-04-10  0:21 ` [PATCH net-next 0/12] RDS: updates for net-next David Miller

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).