RCU was added to UDP lookups, using a fast infrastructure :
- sockets kmem_cache use SLAB_DESTROY_BY_RCU and dont pay the
price of call_rcu() at freeing time.
- hlist_nulls permits to use few memory barriers.
This patch uses same infrastructure for TCP/DCCP established
and timewait sockets.
Thanks to SLAB_DESTROY_BY_RCU, no slowdown for applications
using short lived TCP connections. A followup patch, converting
rwlocks to spinlocks will even speedup this case.
__inet_lookup_established() is pretty fast now we dont have to
dirty a contended cache line (read_lock/read_unlock)
Only established and timewait hashtable are converted to RCU
(bind table and listen table are still using traditional locking)
Signed-off-by: Eric Dumazet <redacted>
---
include/net/inet_hashtables.h | 4 -
include/net/inet_timewait_sock.h | 10 +--
net/core/sock.c | 4 +
net/dccp/ipv4.c | 1
net/dccp/ipv6.c | 1
net/dccp/proto.c | 4 -
net/ipv4/inet_diag.c | 6 +-
net/ipv4/inet_hashtables.c | 78 ++++++++++++++++++++---------
net/ipv4/inet_timewait_sock.c | 26 +++++----
net/ipv4/tcp.c | 4 -
net/ipv4/tcp_ipv4.c | 25 ++++-----
net/ipv6/inet6_hashtables.c | 70 +++++++++++++++++---------
net/ipv6/tcp_ipv6.c | 1
13 files changed, 150 insertions(+), 84 deletions(-)