diff mbox

[PATCHv2,3/6] rds: check for excessive looping in rds_send_xmit

Message ID 5f877b89716358c7a08272275979b5e039ca1c29.1427983908.git.sowmini.varadhan@oracle.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Sowmini Varadhan April 2, 2015, 2:19 p.m. UTC
Original patch by Andy Grover

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 net/rds/send.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Comments

David Miller April 2, 2015, 6:08 p.m. UTC | #1
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Thu,  2 Apr 2015 10:19:37 -0400

> @@ -177,6 +178,18 @@ int rds_send_xmit(struct rds_connection *conn)
>  
>  		rm = conn->c_xmit_rm;
>  
> +		if (!rm) {
> +			same_rm = 0;
> +		} else {
> +			same_rm++;
> +			if (same_rm >= 4096) {
> +				printk_ratelimited(KERN_ERR "RDS: Stuck rm\n");
> +				cond_resched();
> +				ret = -EAGAIN;
> +				break;
> +			}
> +		}
> +

I'm not accepting junk like this.

I want to know exactly how this situation can occur, in detail, and
then and only then can we start to talk about more reasonable
solutions to this bug.

This looks like a minimal effort hack to make a hang go away, and
even more concerning is that a change like this is submitted with
a commit message that is essentially empty.

Sorry, this is not acceptable.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/rds/send.c b/net/rds/send.c
index 44672be..b1741a2 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -140,6 +140,7 @@  int rds_send_xmit(struct rds_connection *conn)
 	struct scatterlist *sg;
 	int ret = 0;
 	LIST_HEAD(to_be_dropped);
+	int same_rm = 0;
 
 restart:
 
@@ -177,6 +178,18 @@  int rds_send_xmit(struct rds_connection *conn)
 
 		rm = conn->c_xmit_rm;
 
+		if (!rm) {
+			same_rm = 0;
+		} else {
+			same_rm++;
+			if (same_rm >= 4096) {
+				printk_ratelimited(KERN_ERR "RDS: Stuck rm\n");
+				cond_resched();
+				ret = -EAGAIN;
+				break;
+			}
+		}
+
 		/*
 		 * If between sending messages, we can send a pending congestion
 		 * map update.