]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'net-inet-retire-port-only-listening_hash'
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:52:21 +0000 (16:52 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:52:22 +0000 (16:52 -0700)
commitc71745c57cd486973618e591f945a3c9d2194aa5
tree7d2bdd36a14880cafe9595bf3317696342ea33b9
parent036bfb61e7fc1e407247eaaea41b8dd41b8b7cb3
parent52921b9c461c0c4654ce89995c32fef7b87e78f0
Merge branch 'net-inet-retire-port-only-listening_hash'

Martin KaFai Lau says:

====================
net: inet: Retire port only listening_hash

This series is to retire the port only listening_hash.

The listen sk is currently stored in two hash tables,
listening_hash (hashed by port) and lhash2 (hashed by port and address).

After commit e4a69f3e8344 ("net: tcp6: prefer listeners bound to an address")
and commit 17faeae80425 ("net: tcp: prefer listeners bound to an address"),
the TCP-SYN lookup fast path does not use listening_hash.

The commit 851cb89656de ("tcp: seq_file: Replace listening_hash with lhash2")
also moved the seq_file (/proc/net/tcp) iteration usage from
listening_hash to lhash2.

There are still a few listening_hash usages left.
One of them is inet_reuseport_add_sock() which uses the listening_hash
to search a listen sk during the listen() system call.  This turns
out to be very slow on use cases that listen on many different
VIPs at a popular port (e.g. 443).  [ On top of the slowness in
adding to the tail in the IPv6 case ]. A latter patch has a
selftest to demonstrate this case.

This series takes this chance to move all remaining listening_hash
usages to lhash2 and then retire listening_hash.
====================

Link: https://lore.kernel.org/r/20220512000546.188616-1-kafai@fb.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>