Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rds: check for excessive looping in rds_send_xmit

Original commit from 2011 updated to include a change by
Yuval Shaia <yuval.shaia@oracle.com>
that adds a new statistic counter "send_stuck_rm"
to capture the messages looping exessively
in the send path.

Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Grover and committed by
David S. Miller
11740ef4 55c70ca0

+14 -1
+1 -1
net/rds/rds.h
··· 717 717 uint64_t s_cong_send_blocked; 718 718 uint64_t s_recv_bytes_added_to_socket; 719 719 uint64_t s_recv_bytes_removed_from_socket; 720 - 720 + uint64_t s_send_stuck_rm; 721 721 }; 722 722 723 723 /* af_rds.c */
+12
net/rds/send.c
··· 145 145 LIST_HEAD(to_be_dropped); 146 146 int batch_count; 147 147 unsigned long send_gen = 0; 148 + int same_rm = 0; 148 149 149 150 restart: 150 151 batch_count = 0; ··· 200 199 while (1) { 201 200 202 201 rm = cp->cp_xmit_rm; 202 + 203 + if (!rm) { 204 + same_rm = 0; 205 + } else { 206 + same_rm++; 207 + if (same_rm >= 4096) { 208 + rds_stats_inc(s_send_stuck_rm); 209 + ret = -EAGAIN; 210 + break; 211 + } 212 + } 203 213 204 214 /* 205 215 * If between sending messages, we can send a pending congestion
+1
net/rds/stats.c
··· 78 78 "cong_send_blocked", 79 79 "recv_bytes_added_to_sock", 80 80 "recv_bytes_freed_fromsock", 81 + "send_stuck_rm", 81 82 }; 82 83 83 84 void rds_stats_info_copy(struct rds_info_iterator *iter,