From: Santosh Shilimkar Date: Thu, 22 Feb 2018 19:16:38 +0000 (-0800) Subject: Revert "RDS: don't commit to queue till transport connection is up" X-Git-Tag: v4.1.12-124.31.3~969 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d85826257da927372c3f023dda068f37248702f5;p=users%2Fjedix%2Flinux-maple.git Revert "RDS: don't commit to queue till transport connection is up" This reverts commit 238a807df5e57afb4b1e13ba87015093e3212247. This change was introduced to address the RDS internal sendQ occupancy for the messages targeted to dead/non-existing nodes. It was discovered as part of a customer issue where remote node was shut down and RDS attempted to repeatedly establish a connection without success. Same issue can be exploited by sending messages to non-existing node too since RDS forms connection as part of sendmsg if it doesn't exist already. While at that time sending EAGAIN instead of adding messages to sendQ when remote connection not up, looked straightforward, it has undesired effect on application to keep spinning even though there is space to write on socket buffer. And application has no notion of underneath connections, so RDS needs to handle this problem internally and transparently. Application will automatically move to POLL OUT once its own socket buffer is full and will avoid the CPU tight spinning. To address draining the internal sendQ messages targeted to dead nodes or non-existing nodes, one possible way is to retire/destroy those connections, after some large timeout. That will also drop those messages from sendQ. This change will be addressed separately. Orabug: 27606911 Signed-off-by: Santosh Shilimkar Reviewed-by: Wei Lin Guay --- diff --git a/net/rds/send.c b/net/rds/send.c index 73a1b8b76b34..dc55f36de8d5 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1424,11 +1424,6 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) goto out; } - if (!rds_conn_path_up(cpath)) { - ret = -EAGAIN; - goto out; - } - while (!rds_send_queue_rm(rs, conn, cpath, rm, rs->rs_bound_port, dport, &queued)) { rds_stats_inc(s_send_queue_full);