mbox series

[net-next,0/3] tcp: add fast path in timer handlers

Message ID 20241002173042.917928-1-edumazet@google.com (mailing list archive)
Headers show
Series tcp: add fast path in timer handlers | expand

Message

Eric Dumazet Oct. 2, 2024, 5:30 p.m. UTC
As mentioned in Netconf 2024:

TCP retransmit and delack timers are not stopped from
inet_csk_clear_xmit_timer() because we do not define
INET_CSK_CLEAR_TIMERS.

Enabling INET_CSK_CLEAR_TIMERS leads to lower performance,
mainly because del_timer() and mod_timer() happen from
different cpus quite often.

What we can do instead is to add fast paths to tcp_write_timer()
and tcp_delack_timer() to avoid socket spinlock acquisition.

Eric Dumazet (3):
  tcp: annotate data-races around icsk->icsk_pending
  tcp: add a fast path in tcp_write_timer()
  tcp: add a fast path in tcp_delack_timer()

 include/net/inet_connection_sock.h |  9 +++++----
 net/ipv4/inet_connection_sock.c    |  6 ++++--
 net/ipv4/inet_diag.c               | 10 ++++++----
 net/ipv4/tcp_ipv4.c                | 10 ++++++----
 net/ipv4/tcp_output.c              |  7 ++++---
 net/ipv4/tcp_timer.c               | 18 ++++++++++++++++--
 net/ipv6/tcp_ipv6.c                | 10 ++++++----
 net/mptcp/protocol.c               |  3 ++-
 8 files changed, 49 insertions(+), 24 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 4, 2024, 11:20 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  2 Oct 2024 17:30:39 +0000 you wrote:
> As mentioned in Netconf 2024:
> 
> TCP retransmit and delack timers are not stopped from
> inet_csk_clear_xmit_timer() because we do not define
> INET_CSK_CLEAR_TIMERS.
> 
> Enabling INET_CSK_CLEAR_TIMERS leads to lower performance,
> mainly because del_timer() and mod_timer() happen from
> different cpus quite often.
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] tcp: annotate data-races around icsk->icsk_pending
    https://git.kernel.org/netdev/net-next/c/5a9071a760a6
  - [net-next,2/3] tcp: add a fast path in tcp_write_timer()
    https://git.kernel.org/netdev/net-next/c/3b7842930162
  - [net-next,3/3] tcp: add a fast path in tcp_delack_timer()
    https://git.kernel.org/netdev/net-next/c/81df4fa94ee8

You are awesome, thank you!