Skip to contentSkip to conversation

RDS: fix rds-ping spinlock recursion

PATCH In review Jeff Liu 2 participants 2 messages Oct 9, 2012

Subsystems (3)
lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH v2 1/1 RDS: fix rds-ping spinlock recursion

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.

CC Venkat Venkatsubra <[email protected]>
CC David S. Miller <[email protected]>
CC James Morris <[email protected]>
---
 net/rds/send.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/rds/send.c +1 -1
index 96531d4..88eace5 100644
@@ -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;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

From: Jeff Liu <[email protected]>
Date: Tue, 09 Oct 2012 12:57:27 +0800

Quoted 8 lines

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.

Quoted 8 lines

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.

CC Venkat Venkatsubra <[email protected]>
CC David S. Miller <[email protected]>
CC James Morris <[email protected]>

Applied and queued up for -stable, thanks.