Skip to content

Commit d63de36

Browse files
venkatxvenkatsubrajfvogel
authored andcommitted
net/rds: Fix endless RNR situation
Working with the following SRs: Exadata SR# 3-15640329311 Linux SR#3-15675579325 it was discovered that by inserting IB_SEND_SOLICITED at regular intervals removed the endless RNR Retry situation. The test was made by inserting IB_SEND_SOLICITED at the same interval as IB_SEND_SIGNALED was inserted, that is, by default for every 17th fragment. This commit introduces the sysctl variable net.rds.ib.max_unsolicited_wr. A value of zero disables the functionality of inserting IB_SEND_SOLICITED. A value of N will insert IB_SEND_SOLICITED for every Nth fragment. net.rds.ib.max_unsolicited_wr is by default 16, in order to avoid customization when this fix is applied at the customer site. This fix also has the nice side-effect that it improves IOPS for 1Q, 1D, 1T cases: -q 1M -a 256: Without fix: tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu % 1 1161 0 1189243.20 0.00 0.00 203.52 857.34 -1.00 (average) With fix (with default net.rds.ib.max_unsolicited_wr = 16): tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu % 1 1323 0 1355849.36 0.00 0.00 203.76 751.50 -1.00 (average) -q $[32*1024+256] -a 256: With fix (net.rds.ib.max_unsolicited_wr = 0, i.e. disabled): tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu % 1 15243 0 492547.75 0.00 0.00 10.58 62.01 -1.00 (average) Ditto with net.rds.ib.max_unsolicited_wr = 4 (two SEND_SOLICITED per ~32K): tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu % 1 16422 0 530641.03 0.00 0.00 10.28 57.25 -1.00 (average) Orabug: 28856912 Reviewed-by: Håkon Bugge <[email protected]> Signed-off-by: Venkat Venkatsubra <[email protected]>
1 parent 5c11616 commit d63de36

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

net/rds/ib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ struct rds_ib_connection {
259259

260260
/* Batched completions */
261261
unsigned int i_unsignaled_wrs;
262+
263+
/* Wake up receiver once in a while */
264+
unsigned int i_unsolicited_wrs;
262265
u8 i_sl;
263266

264267
atomic_t i_cache_allocs;
@@ -600,6 +603,7 @@ void rds_ib_sysctl_exit(void);
600603
extern unsigned long rds_ib_sysctl_max_send_wr;
601604
extern unsigned long rds_ib_sysctl_max_recv_wr;
602605
extern unsigned long rds_ib_sysctl_max_unsig_wrs;
606+
extern unsigned long rds_ib_sysctl_max_unsolicited_wrs;
603607
extern unsigned long rds_ib_sysctl_max_unsig_bytes;
604608
extern unsigned long rds_ib_sysctl_max_recv_allocation;
605609
extern unsigned int rds_ib_sysctl_flow_control;

net/rds/ib_send.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,15 @@ static inline int rds_ib_set_wr_signal_state(struct rds_ib_connection *ic,
538538
if (ic->i_unsignaled_wrs-- == 0 || notify) {
539539
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
540540
send->s_wr.send_flags |= IB_SEND_SIGNALED;
541-
return 1;
542541
}
543-
return 0;
542+
543+
/* To keep the rx pipeline going, add SEND_SOLIICITED once in a while */
544+
if (rds_ib_sysctl_max_unsolicited_wrs && --ic->i_unsolicited_wrs == 0) {
545+
ic->i_unsolicited_wrs = rds_ib_sysctl_max_unsolicited_wrs;
546+
send->s_wr.send_flags |= IB_SEND_SOLICITED;
547+
}
548+
549+
return !!(send->s_wr.send_flags & IB_SEND_SIGNALED);
544550
}
545551

546552
/*
@@ -645,6 +651,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
645651
rm->data.op_count = 0;
646652
}
647653

654+
ic->i_unsolicited_wrs = rds_ib_sysctl_max_unsolicited_wrs;
648655
rds_message_addref(rm);
649656
rm->data.op_dmasg = 0;
650657
rm->data.op_dmaoff = 0;

net/rds/ib_sysctl.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ unsigned long rds_ib_sysctl_max_unsig_wrs = 16;
4949
static unsigned long rds_ib_sysctl_max_unsig_wr_min = 1;
5050
static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64;
5151

52+
unsigned long rds_ib_sysctl_max_unsolicited_wrs = 16;
53+
54+
/* Zero means inserting SEND_SOLICITED in the middle of an RDS message
55+
* is disabled
56+
*/
57+
static unsigned long rds_ib_sysctl_max_unsolicited_wr_min;
58+
/* Nmbr frags of 1MB + 256B RDBMS hdr */
59+
static unsigned long rds_ib_sysctl_max_unsolicited_wr_max =
60+
(1 * 1024 * 1024 + RDS_FRAG_SIZE) / RDS_FRAG_SIZE;
61+
5262
/*
5363
* This sysctl does nothing.
5464
*
@@ -91,6 +101,15 @@ static struct ctl_table rds_ib_sysctl_table[] = {
91101
.extra1 = &rds_ib_sysctl_max_unsig_wr_min,
92102
.extra2 = &rds_ib_sysctl_max_unsig_wr_max,
93103
},
104+
{
105+
.procname = "max_unsolicited_wr",
106+
.data = &rds_ib_sysctl_max_unsolicited_wrs,
107+
.maxlen = sizeof(unsigned long),
108+
.mode = 0644,
109+
.proc_handler = &proc_doulongvec_minmax,
110+
.extra1 = &rds_ib_sysctl_max_unsolicited_wr_min,
111+
.extra2 = &rds_ib_sysctl_max_unsolicited_wr_max,
112+
},
94113
{
95114
.procname = "max_recv_allocation",
96115
.data = &rds_ib_sysctl_max_recv_allocation,

0 commit comments

Comments
 (0)