HomeFreeBSD

tcp_hostcache: use SMR for lookups, mutex(9) for updates.

Description

tcp_hostcache: use SMR for lookups, mutex(9) for updates.

In certain cases, e.g. a SYN-flood from a limited set of hosts,
the TCP hostcache becomes the main contention point. To solve
that, this change introduces lockless lookups on the hostcache.

The cache remains a hash, however buckets are now CK_SLIST. For
updates a bucket mutex is obtained, for read an SMR section is
entered.

Reviewed by: markj, rscheff
Differential revision: https://reviews.freebsd.org/D29729

Details

Provenance
glebiusAuthored on Mar 22 2021, 10:32 PM
Reviewer
markj
Differential Revision
D29729: SMR for TCP hostcache.
Parents
rG1db08fbe3ffa: tcp_input: always request read-locking of PCB for any pure SYN segment.
Branches
Unknown
Tags
Unknown