Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6d14070 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7a01ab3
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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_mstamp = div_u64(val, NSEC_PER_USEC);
}

static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,