From 11740ef4482914fcd8c9814ef7ceb7085715e554 Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Thu, 13 Jan 2011 11:40:31 -0800 Subject: rds: check for excessive looping in rds_send_xmit Original commit from 2011 updated to include a change by Yuval Shaia that adds a new statistic counter "send_stuck_rm" to capture the messages looping exessively in the send path. Signed-off-by: Gerd Rausch Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller --- net/rds/send.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'net/rds/send.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 @@ restart: 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. -- cgit v1.2.3