Skip to content

Commit 11740ef

Browse files
Andy Groverdavem330
authored andcommitted
rds: check for excessive looping in rds_send_xmit
Original commit from 2011 updated to include a change by Yuval Shaia <[email protected]> that adds a new statistic counter "send_stuck_rm" to capture the messages looping exessively in the send path. Signed-off-by: Gerd Rausch <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 55c70ca commit 11740ef

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

net/rds/rds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ struct rds_statistics {
717717
uint64_t s_cong_send_blocked;
718718
uint64_t s_recv_bytes_added_to_socket;
719719
uint64_t s_recv_bytes_removed_from_socket;
720-
720+
uint64_t s_send_stuck_rm;
721721
};
722722

723723
/* af_rds.c */

net/rds/send.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
145145
LIST_HEAD(to_be_dropped);
146146
int batch_count;
147147
unsigned long send_gen = 0;
148+
int same_rm = 0;
148149

149150
restart:
150151
batch_count = 0;
@@ -200,6 +201,17 @@ int rds_send_xmit(struct rds_conn_path *cp)
200201

201202
rm = cp->cp_xmit_rm;
202203

204+
if (!rm) {
205+
same_rm = 0;
206+
} else {
207+
same_rm++;
208+
if (same_rm >= 4096) {
209+
rds_stats_inc(s_send_stuck_rm);
210+
ret = -EAGAIN;
211+
break;
212+
}
213+
}
214+
203215
/*
204216
* If between sending messages, we can send a pending congestion
205217
* map update.

net/rds/stats.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static const char *const rds_stat_names[] = {
7878
"cong_send_blocked",
7979
"recv_bytes_added_to_sock",
8080
"recv_bytes_freed_fromsock",
81+
"send_stuck_rm",
8182
};
8283

8384
void rds_stats_info_copy(struct rds_info_iterator *iter,

0 commit comments

Comments
 (0)