All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] RDS: fix rds-ping spinlock recursion
@ 2012-10-09  4:57 Jeff Liu
  2012-10-09 17:58 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2012-10-09  4:57 UTC (permalink / raw)
  To: rds-devel; +Cc: Venkat Venkatsubra, davem, Dan Carpenter, James Morris, netdev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] RDS: fix rds-ping spinlock recursion
  2012-10-09  4:57 [PATCH v2] RDS: fix rds-ping spinlock recursion Jeff Liu
@ 2012-10-09 17:58 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-10-09 17:58 UTC (permalink / raw)
  To: jeff.liu
  Cc: rds-devel, venkat.x.venkatsubra, dan.carpenter, james.l.morris, netdev

From: Jeff Liu <jeff.liu@oracle.com>
Date: Tue, 09 Oct 2012 12:57:27 +0800

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

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-09 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09  4:57 [PATCH v2] RDS: fix rds-ping spinlock recursion Jeff Liu
2012-10-09 17:58 ` David Miller

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.