All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Rausch <gerd.rausch@oracle.com>
To: Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com
Cc: David Miller <davem@davemloft.net>
Subject: [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit
Date: Thu, 15 Aug 2019 07:43:15 -0700	[thread overview]
Message-ID: <d91e3273-48bb-13bf-af65-40472890f975@oracle.com> (raw)
In-Reply-To: <cover.1565879451.git.gerd.rausch@oracle.com>

From: Andy Grover <andy.grover@oracle.com>
Date: Thu, 13 Jan 2011 11:40:31 -0800

Original commit from 2011 updated to include a change by
Yuval Shaia <yuval.shaia@oracle.com>
that adds a new statistic counter "send_stuck_rm"
to capture the messages looping exessively
in the send path.

Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
---
 net/rds/rds.h   |  2 +-
 net/rds/send.c  | 12 ++++++++++++
 net/rds/stats.c |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/net/rds/rds.h b/net/rds/rds.h
index f0066d168499..ad605fd61655 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -717,7 +717,7 @@ struct rds_statistics {
 	uint64_t	s_cong_send_blocked;
 	uint64_t	s_recv_bytes_added_to_socket;
 	uint64_t	s_recv_bytes_removed_from_socket;
-
+	uint64_t	s_send_stuck_rm;
 };
 
 /* af_rds.c */
diff --git a/net/rds/send.c b/net/rds/send.c
index 031b1e97a466..9ce552abf9e9 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -145,6 +145,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
 	LIST_HEAD(to_be_dropped);
 	int batch_count;
 	unsigned long send_gen = 0;
+	int same_rm = 0;
 
 restart:
 	batch_count = 0;
@@ -200,6 +201,17 @@ int rds_send_xmit(struct rds_conn_path *cp)
 
 		rm = cp->cp_xmit_rm;
 
+		if (!rm) {
+			same_rm = 0;
+		} else {
+			same_rm++;
+			if (same_rm >= 4096) {
+				rds_stats_inc(s_send_stuck_rm);
+				ret = -EAGAIN;
+				break;
+			}
+		}
+
 		/*
 		 * If between sending messages, we can send a pending congestion
 		 * map update.
diff --git a/net/rds/stats.c b/net/rds/stats.c
index 6bbab4d74c4f..9e87da43c004 100644
--- a/net/rds/stats.c
+++ b/net/rds/stats.c
@@ -78,6 +78,7 @@ static const char *const rds_stat_names[] = {
 	"cong_send_blocked",
 	"recv_bytes_added_to_sock",
 	"recv_bytes_freed_fromsock",
+	"send_stuck_rm",
 };
 
 void rds_stats_info_copy(struct rds_info_iterator *iter,
-- 
2.22.1


  parent reply	other threads:[~2019-08-15 14:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 18:20 [PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl Gerd Rausch
2019-08-13 22:07 ` santosh.shilimkar
2019-08-14 15:56 ` Doug Ledford
2019-08-14 17:41   ` Gerd Rausch
2019-08-14 18:01   ` santosh.shilimkar
2019-08-14 18:21     ` David Miller
2019-08-14 18:36       ` santosh.shilimkar
2019-08-14 21:31         ` David Miller
2019-08-14 21:45           ` Gerd Rausch
2019-08-15  1:25             ` David Miller
2019-08-15 14:40               ` [PATCH net-next v2 0/4] net/rds: Fixes from internal Oracle repo Gerd Rausch
2019-08-15 19:04                 ` David Miller
     [not found]               ` <cover.1565879451.git.gerd.rausch@oracle.com>
2019-08-15 14:42                 ` [PATCH net-next v2 1/4] RDS: limit the number of times we loop in rds_send_xmit Gerd Rausch
2019-08-15 16:16                   ` santosh.shilimkar
2019-08-15 14:42                 ` [PATCH net-next v2 2/4] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create Gerd Rausch
2019-08-15 16:17                   ` santosh.shilimkar
2019-08-15 14:42                 ` [PATCH net-next v2 3/4] net/rds: Add a few missing rds_stat_names entries Gerd Rausch
2019-08-15 16:17                   ` santosh.shilimkar
2019-08-15 14:43                 ` Gerd Rausch [this message]
2019-08-15 16:18                   ` [PATCH net-next v2 4/4] rds: check for excessive looping in rds_send_xmit santosh.shilimkar

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=d91e3273-48bb-13bf-af65-40472890f975@oracle.com \
    --to=gerd.rausch@oracle.com \
    --cc=davem@davemloft.net \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.