From d65746088d2de3a7c1d569e73a5ef3a764d071a4 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Mon, 22 Jul 2019 06:47:33 +0000 Subject: [PATCH] tcp: hint compiler about sack flows mainline inclusion from mainline-v5.0-rc1 commit ebeef4bcccf4681ba3de04fbf3a005f6054f7999 category: perf bugzilla: NA CVE: NA ------------------------------------------------- Tell the compiler that most TCP flows are using SACK these days. There is no need to add the unlikely() clause in tcp_is_reno(), the compiler is able to infer it. Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Yuchung Cheng Signed-off-by: David S. Miller Signed-off-by: Biaoxiang Reviewed-by: Mao Wenan Signed-off-by: Yang Yingliang --- include/net/tcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index e75661f92daa..741154d70a9a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1115,7 +1115,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) -- GitLab