Skip to content

Commit 812c027

Browse files
RDS: restore the exponential back-off scheme
Lower IP and exponential back-off scheme was added to save the SM queries because of races but it doesn't do what its intended. The exponential back-off scheme does a good job of backing off for races. The code just falls back to the original scheme. Orabug: 22347191 Tested-by: Michael Nowak <[email protected]> Tested-by: Rafael Alejandro Peralez <[email protected]> Tested-by: Liwen Huang <[email protected]> Tested-by: Hong Liu <[email protected]> Reviewed-by: Mukesh Kacker <[email protected]> Signed-off-by: Santosh Shilimkar <[email protected]>
1 parent 61dce74 commit 812c027

File tree

5 files changed

+1
-32
lines changed

5 files changed

+1
-32
lines changed

net/rds/connection.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ void rds_conn_drop(struct rds_connection *conn, int reason)
750750
conn->c_reconnect_warn = 1;
751751
conn->c_reconnect_drops = 0;
752752
conn->c_reconnect_err = 0;
753-
conn->c_reconnect_racing = 0;
754753
printk(KERN_INFO "RDS/IB: connection "
755754
"<%u.%u.%u.%u,%u.%u.%u.%u,%d> dropped due to '%s'\n",
756755
NIPQUAD(conn->c_laddr),

net/rds/ib_cm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,6 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
915915
} else if (rds_conn_state(conn) == RDS_CONN_CONNECTING) {
916916
unsigned long now = get_seconds();
917917

918-
conn->c_reconnect_racing++;
919-
920918
/*
921919
* after 15 seconds, give up on existing connection
922920
* attempts and make them try again. At this point

net/rds/rdma_transport.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
258258
case RDMA_CM_EVENT_REJECTED:
259259
err = (int *)event->param.conn.private_data;
260260

261-
if (conn && event->status == RDS_REJ_CONSUMER_DEFINED &&
262-
*err <= 1)
263-
conn->c_reconnect_racing++;
264-
265261
if (conn) {
266262
if (event->status == RDS_REJ_CONSUMER_DEFINED &&
267263
(*err) == 0) {

net/rds/rds.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ struct rds_connection {
293293

294294
unsigned int c_rdsinfo_pending;
295295

296-
unsigned int c_reconnect_racing;
297296
unsigned int c_route_resolved;
298297

299298
enum rds_conn_drop_src c_drop_source;

net/rds/threads.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,8 @@ void rds_queue_reconnect(struct rds_connection *conn)
150150
rand % conn->c_reconnect_jiffies, conn->c_reconnect_jiffies,
151151
conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
152152

153-
if (conn->c_laddr >= conn->c_faddr)
154153
queue_delayed_work(conn->c_wq, &conn->c_conn_w,
155154
rand % conn->c_reconnect_jiffies);
156-
else
157-
queue_delayed_work(conn->c_wq, &conn->c_conn_w,
158-
msecs_to_jiffies(100));
159155

160156
conn->c_reconnect_jiffies = min(conn->c_reconnect_jiffies * 2,
161157
rds_sysctl_reconnect_max_jiffies);
@@ -297,7 +293,6 @@ void rds_reconnect_timeout(struct work_struct *work)
297293
NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
298294
conn->c_tos);
299295
rds_conn_drop(conn, DR_RECONNECT_TIMEOUT);
300-
conn->c_reconnect_racing = 0;
301296
}
302297
}
303298

@@ -315,25 +310,7 @@ void rds_shutdown_worker(struct work_struct *work)
315310
conn->c_tos,
316311
conn_drop_reason_str(conn->c_drop_source));
317312

318-
/* if racing is detected, lower IP backs off and let the higher IP
319-
* drives the reconnect (one-sided reconnect)
320-
*/
321-
if (conn->c_laddr < conn->c_faddr && conn->c_reconnect_racing) {
322-
rds_rtd(RDS_RTD_CM,
323-
"calling rds_conn_shutdown, conn %p:0 <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
324-
conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
325-
conn->c_tos);
326-
rds_conn_shutdown(conn, 0);
327-
queue_delayed_work(conn->c_wq, &conn->c_reconn_w,
328-
msecs_to_jiffies(5000));
329-
} else {
330-
rds_rtd(RDS_RTD_CM,
331-
"calling rds_conn_shutdown, conn %p:1 <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
332-
conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
333-
conn->c_tos);
334-
rds_conn_shutdown(conn, 1);
335-
}
336-
313+
rds_conn_shutdown(conn, 1);
337314
}
338315

339316
void rds_threads_exit(void)

0 commit comments

Comments
 (0)