aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-03-22 06:26:29 -0700
committerDavid S. Miller <davem@davemloft.net>2019-03-23 21:43:21 -0400
commite6d1407013a91722ffc89e980d715eb9ce7b57f6 (patch)
tree2db96af75038ab5fbcc8010c0f060fab98dd906d /net/ipv4/tcp_output.c
parentnet: phy: Correct Cygnus/Omega PHY driver prompt (diff)
downloadlinux-dev-e6d1407013a91722ffc89e980d715eb9ce7b57f6.tar.xz
linux-dev-e6d1407013a91722ffc89e980d715eb9ce7b57f6.zip
tcp: remove conditional branches from tcp_mstamp_refresh()
tcp_clock_ns() (aka ktime_get_ns()) is using monotonic clock, so the checks we had in tcp_mstamp_refresh() are no longer relevant. This patch removes cpu stall (when the cache line is not hot) Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/tcp_output.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 4522579aaca2..e265d1aeeb66 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -52,12 +52,8 @@ void tcp_mstamp_refresh(struct tcp_sock *tp)
{
u64 val = tcp_clock_ns();
- if (val > tp->tcp_clock_cache)
- tp->tcp_clock_cache = val;
-
- val = div_u64(val, NSEC_PER_USEC);
- if (val > tp->tcp_mstamp)
- tp->tcp_mstamp = val;
+ tp->tcp_clock_cache = val;
+ tp->tcp_mstamp = div_u64(val, NSEC_PER_USEC);
}
static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,