diff options
author | Joanne Koong <joannelkoong@gmail.com> | 2022-05-20 02:18:33 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-05-21 03:16:24 +0200 |
commit | d5a42de8bdbe25081f07b801d8b35f4d75a791f4 (patch) | |
tree | 7bc53e45ea3628a75c25931f9f1d5c7f64d63cd5 /lib/test_parman.c | |
parent | wwan: iosm: use a flexible array rather than allocate short objects (diff) | |
download | linux-d5a42de8bdbe25081f07b801d8b35f4d75a791f4.tar.xz linux-d5a42de8bdbe25081f07b801d8b35f4d75a791f4.zip |
net: Add a second bind table hashed by port and address
We currently have one tcp bind table (bhash) which hashes by port
number only. In the socket bind path, we check for bind conflicts by
traversing the specified port's inet_bind2_bucket while holding the
bucket's spinlock (see inet_csk_get_port() and inet_csk_bind_conflict()).
In instances where there are tons of sockets hashed to the same port
at different addresses, checking for a bind conflict is time-intensive
and can cause softirq cpu lockups, as well as stops new tcp connections
since __inet_inherit_port() also contests for the spinlock.
This patch proposes adding a second bind table, bhash2, that hashes by
port and ip address. Searching the bhash2 table leads to significantly
faster conflict resolution and less time holding the spinlock.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions