Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753486AbbDBOUG (ORCPT ); Thu, 2 Apr 2015 10:20:06 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:28451 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbbDBOT4 (ORCPT ); Thu, 2 Apr 2015 10:19:56 -0400 From: Sowmini Varadhan 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, sergei.shtylyov@cogentembedded.com, Sowmini Varadhan Subject: [PATCHv2 3/6] rds: check for excessive looping in rds_send_xmit Date: Thu, 2 Apr 2015 10:19:37 -0400 Message-Id: <5f877b89716358c7a08272275979b5e039ca1c29.1427983908.git.sowmini.varadhan@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 46 Original patch by Andy Grover Signed-off-by: Sowmini Varadhan --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/