aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-11-30 13:26:54 -0800
committerDavid S. Miller <davem@davemloft.net>2018-11-30 13:26:54 -0800
commit2f69555315ad7dc1ac37366b2ac2429e2d24d444 (patch)
tree3b70704dbf9f7cf27ec16d9321f7c1956b81c3a5 /include/net/tcp.h
parentnet: Add trace events for all receive exit points (diff)
parenttcp: implement coalescing on backlog queue (diff)
downloadlinux-dev-2f69555315ad7dc1ac37366b2ac2429e2d24d444.tar.xz
linux-dev-2f69555315ad7dc1ac37366b2ac2429e2d24d444.zip
Merge branch 'tcp-take-a-bit-more-care-of-backlog-stress'
Eric Dumazet says: ==================== tcp: take a bit more care of backlog stress While working on the SACK compression issue Jean-Louis Dupond reported, we found that his linux box was suffering very hard from tail drops on the socket backlog queue. First patch hints the compiler about sack flows being the norm. Second patch changes non-sack code in preparation of the ack compression. Third patch fixes tcp_space() to take backlog into account. Fourth patch is attempting coalescing when a new packet must be added to the backlog queue. Cooking bigger skbs helps to keep backlog list smaller and speeds its handling when user thread finally releases the socket lock. v3: Neal/Yuchung feedback addressed : Do not aggregate if any skb has URG bit set. Do not aggregate if the skbs have different ECE/CWR bits v2: added feedback from Neal : tcp: take care of compressed acks in tcp_add_reno_sack() added : tcp: hint compiler about sack flows added : tcp: make tcp_space() aware of socket backlog ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 63e37dd1c274..3b522259da7d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1124,7 +1124,7 @@ void tcp_rate_check_app_limited(struct sock *sk);
*/
static inline int tcp_is_sack(const struct tcp_sock *tp)
{
- return tp->rx_opt.sack_ok;
+ return likely(tp->rx_opt.sack_ok);
}
static inline bool tcp_is_reno(const struct tcp_sock *tp)
@@ -1368,7 +1368,7 @@ static inline int tcp_win_from_space(const struct sock *sk, int space)
/* Note: caller must be prepared to deal with negative returns */
static inline int tcp_space(const struct sock *sk)
{
- return tcp_win_from_space(sk, sk->sk_rcvbuf -
+ return tcp_win_from_space(sk, sk->sk_rcvbuf - sk->sk_backlog.len -
atomic_read(&sk->sk_rmem_alloc));
}