netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] tcp: even faster connect() under stress
@ 2025-03-05  3:45 Eric Dumazet
  2025-03-05  3:45 ` [PATCH net-next 1/2] inet: change lport contribution to inet_ehashfn() and inet6_ehashfn() Eric Dumazet
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Eric Dumazet @ 2025-03-05  3:45 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Neal Cardwell, Kuniyuki Iwashima, Jason Xing, Simon Horman,
	netdev, eric.dumazet, Eric Dumazet

This is a followup on the prior series, "tcp: scale connect() under pressure"

Now spinlocks are no longer in the picture, we see a very high cost
of the inet6_ehashfn() function.

In this series (of 2), I change how lport contributes to inet6_ehashfn()
to ensure better cache locality and call inet6_ehashfn()
only once per connect() system call.

This brings an additional 229 % increase of performance
for "neper/tcp_crr -6 -T 200 -F 30000" stress test,
while greatly improving latency metrics.

Before:
  latency_min=0.014131929
  latency_max=17.895073144
  latency_mean=0.505675853
  latency_stddev=2.125164772
  num_samples=307884
  throughput=139866.80

After:
  latency_min=0.003041375
  latency_max=7.056589232
  latency_mean=0.141075048
  latency_stddev=0.526900516
  num_samples=312996
  throughput=320677.21

Eric Dumazet (2):
  inet: change lport contribution to inet_ehashfn() and inet6_ehashfn()
  inet: call inet6_ehashfn() once from inet6_hash_connect()

 include/net/inet_hashtables.h |  4 +++-
 include/net/ip.h              |  2 +-
 net/ipv4/inet_hashtables.c    | 30 ++++++++++++++++++++----------
 net/ipv6/inet6_hashtables.c   | 19 +++++++++++++------
 4 files changed, 37 insertions(+), 18 deletions(-)

-- 
2.48.1.711.g2feabab25a-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-03-17 13:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05  3:45 [PATCH net-next 0/2] tcp: even faster connect() under stress Eric Dumazet
2025-03-05  3:45 ` [PATCH net-next 1/2] inet: change lport contribution to inet_ehashfn() and inet6_ehashfn() Eric Dumazet
2025-03-06  4:24   ` Kuniyuki Iwashima
2025-03-06  7:54   ` Jason Xing
2025-03-06  8:14     ` Eric Dumazet
2025-03-06  8:19       ` Jason Xing
2025-03-17 13:44   ` kernel test robot
2025-03-05  3:45 ` [PATCH net-next 2/2] inet: call inet6_ehashfn() once from inet6_hash_connect() Eric Dumazet
2025-03-06  4:26   ` Kuniyuki Iwashima
2025-03-06  8:22   ` Jason Xing
2025-03-05  4:01 ` [PATCH net-next 0/2] tcp: even faster connect() under stress Eric Dumazet
2025-03-06 23:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).