From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net-next 7/7] tcp: cdg: use tcp high resolution clock cache Date: Mon, 15 Oct 2018 09:37:58 -0700 Message-ID: <20181015163758.232436-8-edumazet@google.com> References: <20181015163758.232436-1-edumazet@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev , Eric Dumazet , Eric Dumazet To: "David S . Miller" , Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh , Gasper Zejn Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:43562 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbeJPAYR (ORCPT ); Mon, 15 Oct 2018 20:24:17 -0400 Received: by mail-pf1-f196.google.com with SMTP id p24-v6so9947640pff.10 for ; Mon, 15 Oct 2018 09:38:18 -0700 (PDT) In-Reply-To: <20181015163758.232436-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: We store in tcp socket a cache of most recent high resolution clock, there is no need to call local_clock() again, since this cache is good enough. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_cdg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_cdg.c b/net/ipv4/tcp_cdg.c index 06fbe102a425f28b43294925d8d13af4a13ec776..37eebd9103961be4731323cfb4d933b51954e802 100644 --- a/net/ipv4/tcp_cdg.c +++ b/net/ipv4/tcp_cdg.c @@ -146,7 +146,7 @@ static void tcp_cdg_hystart_update(struct sock *sk) return; if (hystart_detect & HYSTART_ACK_TRAIN) { - u32 now_us = div_u64(local_clock(), NSEC_PER_USEC); + u32 now_us = tp->tcp_mstamp; if (ca->last_ack == 0 || !tcp_is_cwnd_limited(sk)) { ca->last_ack = now_us; -- 2.19.0.605.g01d371f741-goog