From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH v3 net-next 1/4] tcp: hint compiler about sack flows Date: Tue, 27 Nov 2018 14:42:00 -0800 Message-ID: <20181127224203.69999-2-edumazet@google.com> References: <20181127224203.69999-1-edumazet@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev , Jean-Louis Dupond , Neal Cardwell , Yuchung Cheng , Eric Dumazet , Eric Dumazet To: "David S . Miller" Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:46287 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbeK1Jlg (ORCPT ); Wed, 28 Nov 2018 04:41:36 -0500 Received: by mail-pg1-f194.google.com with SMTP id w7so8507352pgp.13 for ; Tue, 27 Nov 2018 14:42:12 -0800 (PST) In-Reply-To: <20181127224203.69999-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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 63e37dd1c274cc396e41ea9612cf67a5b7c89776..0c61bf0a06dac95268c26b6302a2afbaef4c88b3 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) -- 2.20.0.rc0.387.gc7a69e6b6c-goog