Skip to content

tcp: even faster connect() under stress

Eric Dumazet netdev oe-lkp 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2inet: change lport contribution to inet_ehashfn() and inet6_ehashfn()net/ipv4/inet_hashtables.c net/ipv6/inet6_hashtables.c+4 -44 repliesApplied
2/2inet: call inet6_ehashfn() once from inet6_hash_connect()include/net/inet_hashtables.h include/net/ip.h net/ipv4/inet_hashtables.c +1 more+33 -142 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKuniyuki IwashimaJason Xing
1/2R-b T-b R-b
2/2R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/2] tcp: even faster connect() under stress

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(-)
Signature · 1 line
2.48.1.711.g2feabab25a-goog