netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: rds-devel@oss.oracle.com
Cc: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>,
	davem@davemloft.net, Dan Carpenter <dan.carpenter@oracle.com>,
	James Morris <james.l.morris@oracle.com>,
	netdev@vger.kernel.org
Subject: [PATCH v2] RDS: fix rds-ping spinlock recursion
Date: Tue, 09 Oct 2012 12:57:27 +0800	[thread overview]
Message-ID: <5073AEB7.9060309@oracle.com> (raw)

Hello,

This is the revised patch for fixing rds-ping spinlock recursion according to Venkat's suggestions.

RDS ping/pong over TCP feature has been broken for years(2.6.39 to 3.6.0) since we
have to set TCP cork and call kernel_sendmsg() between ping/pong which both need to
lock "struct sock *sk". However, this lock has already been hold before rds_tcp_data_ready()
callback is triggerred. As a result, we always facing spinlock resursion which would resulting
in system panic.

Given that RDS ping is only used to test the connectivity and not for serious performance measurements,
we can queue the pong transmit to rds_wq as a delayed response.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
CC: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
CC: David S. Miller <davem@davemloft.net>
CC: James Morris <james.l.morris@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 net/rds/send.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index 96531d4..88eace5 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1122,7 +1122,7 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
 	rds_stats_inc(s_send_pong);
 
 	if (!test_bit(RDS_LL_SEND_FULL, &conn->c_flags))
-		rds_send_xmit(conn);
+		queue_delayed_work(rds_wq, &conn->c_send_w, 0);
 
 	rds_message_put(rm);
 	return 0;
-- 
1.7.9.5

             reply	other threads:[~2012-10-09  4:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  4:57 Jeff Liu [this message]
2012-10-09 17:58 ` [PATCH v2] RDS: fix rds-ping spinlock recursion David Miller

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=5073AEB7.9060309@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=james.l.morris@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=venkat.x.venkatsubra@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 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).