diff options
author | Eric Dumazet <edumazet@google.com> | 2018-05-10 14:59:43 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-11 12:24:37 -0400 |
commit | 73a6bab5aa2a83cb7df85805e08bc03b4065aea7 (patch) | |
tree | 7f542e5b0873c4dc56003c784c2df12fed79364c /include/net/tcp.h | |
parent | 4cbd7a7d3c0fb1373bf981c5498b51c050668acc (diff) |
tcp: switch pacing timer to softirq based hrtimer
linux-4.16 got support for softirq based hrtimers.
TCP can switch its pacing hrtimer to this variant, since this
avoids going through a tasklet and some atomic operations.
pacing timer logic looks like other (jiffies based) tcp timers.
v2: use hrtimer_try_to_cancel() in tcp_clear_xmit_timers()
to correctly release reference on socket if needed.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index cf803fe0fb86..3b1d617b0110 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -557,7 +557,9 @@ void tcp_fin(struct sock *sk); void tcp_init_xmit_timers(struct sock *); static inline void tcp_clear_xmit_timers(struct sock *sk) { - hrtimer_cancel(&tcp_sk(sk)->pacing_timer); + if (hrtimer_try_to_cancel(&tcp_sk(sk)->pacing_timer) == 1) + sock_put(sk); + inet_csk_clear_xmit_timers(sk); } |