aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_hostcache.h
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2021-04-01 08:00:32 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2021-04-16 19:44:00 +0000
commit4052275c2fc5f96b4a208404733713959afe68f6 (patch)
treefc7a25c39a1be2445aacfecc3b8eef22840665a6 /sys/netinet/tcp_hostcache.h
parent632e3363087cb6ef2a7b26a291a044b97afabea7 (diff)
tcp: For hostcache performance, use atomics instead of counters
As accessing the tcp hostcache happens frequently on some classes of servers, it was recommended to use atomic_add/subtract rather than (per-CPU distributed) counters, which have to be summed up at high cost to cache efficiency in a hot codepath. PR: 254333 MFC after: 2 weeks Sponsored by: NetApp, Inc. Reviewed By: #transport, tuexen, jtl Differential Revision: https://reviews.freebsd.org/D29522 (cherry picked from commit 529a2a0f2765f6c57c50a5af6be242c03bf714e3)
Diffstat (limited to 'sys/netinet/tcp_hostcache.h')
-rw-r--r--sys/netinet/tcp_hostcache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/tcp_hostcache.h b/sys/netinet/tcp_hostcache.h
index b5237392acc2..2f7035c0c6af 100644
--- a/sys/netinet/tcp_hostcache.h
+++ b/sys/netinet/tcp_hostcache.h
@@ -74,7 +74,7 @@ struct tcp_hostcache {
u_int hashsize;
u_int hashmask;
u_int bucket_limit;
- counter_u64_t cache_count;
+ u_int cache_count;
u_int cache_limit;
int expire;
int prune;