LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: chien.yen@oracle.com, davem@davemloft.net,
	rds-devel@oss.oracle.com, agrover@redhat.com, clm@fb.com,
	zab@zabbo.net, ajaykumar.hotchandani@oracle.com,
	Sowmini Varadhan <sowmini.varadhan@oracle.com>
Subject: [PATCH 3/6] rds: check for excessive looping in rds_send_xmit
Date: Thu,  2 Apr 2015 09:50:46 -0400	[thread overview]
Message-ID: <5f877b89716358c7a08272275979b5e039ca1c29.1427936719.git.sowmini.varadhan@oracle.com> (raw)
In-Reply-To: <cover.1427936719.git.sowmini.varadhan@oracle.com>
In-Reply-To: <cover.1427936719.git.sowmini.varadhan@oracle.com>

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

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


  parent reply	other threads:[~2015-04-02 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 13:50 [PATCH 0/6] RDS: RDS core bug fixes Sowmini Varadhan
2015-04-02 13:50 ` [PATCH 1/6] RDS: Re-add pf/sol access via sysctl Sowmini Varadhan
2015-04-02 13:50 ` [PATCH 2/6] RDS: only use passive connections when addresses match Sowmini Varadhan
2015-04-02 13:50 ` Sowmini Varadhan [this message]
2015-04-02 13:50 ` [PATCH 4/6] RDS: make sure not to loop forever inside rds_send_xmit Sowmini Varadhan
2015-04-02 13:50 ` [PATCH 5/6] RDS: rds_send_xmit is called under a spinlock, lets not do a cond_resched() Sowmini Varadhan
2015-04-02 13:50 ` [PATCH 6/6] RDS: don't trust the LL_SEND_FULL bit Sowmini Varadhan
2015-04-02 14:06   ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f877b89716358c7a08272275979b5e039ca1c29.1427936719.git.sowmini.varadhan@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=agrover@redhat.com \
    --cc=ajaykumar.hotchandani@oracle.com \
    --cc=chien.yen@oracle.com \
    --cc=clm@fb.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=zab@zabbo.net \
    --subject='Re: [PATCH 3/6] rds: check for excessive looping in rds_send_xmit' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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