diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-08-25 04:30:19 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-08-25 04:30:19 +0200 |
commit | c21e1bf4d8104fb77bbd99f3d1276c0d7c9b28d9 (patch) | |
tree | 73ff51aa3bc284c611e346b14f4ebe8b90f251b8 /kernel/time/ntp.c | |
parent | netlink: fix some kernel-doc comments (diff) | |
parent | selftests/net: Add sk_bind_sendto_listen and sk_connect_zero_addr (diff) | |
download | linux-c21e1bf4d8104fb77bbd99f3d1276c0d7c9b28d9.tar.xz linux-c21e1bf4d8104fb77bbd99f3d1276c0d7c9b28d9.zip |
Merge branch 'add-a-second-bind-table-hashed-by-port-and-address'
Joanne Koong says:
====================
Add a second bind table hashed by port and address
Currently, there is one bind hashtable (bhash) that hashes by port only.
This patchset adds a second bind table (bhash2) that hashes by port and
address.
The motivation for adding bhash2 is to expedite bind requests in situations
where the port has many sockets in its bhash table entry (eg a large number
of sockets bound to different addresses on the same port), which makes checking
bind conflicts costly especially given that we acquire the table entry spinlock
while doing so, which can cause softirq cpu lockups and can prevent new tcp
connections.
We ran into this problem at Meta where the traffic team binds a large number
of IPs to port 443 and the bind() call took a significant amount of time
which led to cpu softirq lockups, which caused packet drops and other failures
on the machine.
When experimentally testing this on a local server for ~24k sockets bound to
the port, the results seen were:
ipv4:
before - 0.002317 seconds
with bhash2 - 0.000020 seconds
ipv6:
before - 0.002431 seconds
with bhash2 - 0.000021 seconds
The additions to the initial bhash2 submission [0] are:
* Updating bhash2 in the cases where a socket's rcv saddr changes after it has
* been bound
* Adding locks for bhash2 hashbuckets
[0] https://lore.kernel.org/netdev/20220520001834.2247810-1-kuba@kernel.org/
v3: https://lore.kernel.org/netdev/20220722195406.1304948-2-joannelkoong@gmail.com/
v2: https://lore.kernel.org/netdev/20220712235310.1935121-1-joannelkoong@gmail.com/
v1: https://lore.kernel.org/netdev/20220623234242.2083895-2-joannelkoong@gmail.com/
====================
Link: https://lore.kernel.org/r/20220822181023.3979645-1-joannelkoong@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel/time/ntp.c')
0 files changed, 0 insertions, 0 deletions