aboutgitcodebugslistschat
path: root/tcp.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-08-22 15:30:00 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-08-22 12:15:41 +0200
commit69303cafbef86ef070d67582169d455eb8da288c (patch)
tree190140275e212f3b822a03161134f2aebcbf7b03 /tcp.h
parenteb8fbdbfd057cf3a10639ecdd91e6387436f31f8 (diff)
downloadpasst-69303cafbef86ef070d67582169d455eb8da288c.tar
passt-69303cafbef86ef070d67582169d455eb8da288c.tar.gz
passt-69303cafbef86ef070d67582169d455eb8da288c.tar.bz2
passt-69303cafbef86ef070d67582169d455eb8da288c.tar.lz
passt-69303cafbef86ef070d67582169d455eb8da288c.tar.xz
passt-69303cafbef86ef070d67582169d455eb8da288c.tar.zst
passt-69303cafbef86ef070d67582169d455eb8da288c.zip
tcp: Remove broken pressure calculations for tcp_defer_handler()
tcp_defer_handler() performs a potentially expensive linear scan of the connection table. So, to mitigate the cost of that we skip if if we're not under at least moderate pressure: either 30% of available connections or 30% (estimated) of available fds used. But, the calculation for this has been broken since it was introduced: we calculate "max_conns" based on c->tcp.conn_count, not TCP_MAX_CONNS, meaning we only exit early if conn_count is less than 30% of itself, i.e. never. If that calculation is "corrected" to be based on TCP_MAX_CONNS, it completely tanks the TCP CRR times for passt - from ~60ms to >1000ms on my laptop. My guess is that this is because in the case of many short lived connections, we're letting the table become much fuller before compacting it. That means that other places which perform a table scan now have to do much, much more. For the time being, simply remove the tests, since they're not doing anything useful. We can reintroduce them more carefully if we see a need for them. This also removes the only user of c->tcp.splice_conn_count, so that can be removed as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.h')
-rw-r--r--tcp.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/tcp.h b/tcp.h
index 1608d58..9eaec3f 100644
--- a/tcp.h
+++ b/tcp.h
@@ -56,7 +56,6 @@ union tcp_listen_epoll_ref {
* struct tcp_ctx - Execution context for TCP routines
* @hash_secret: 128-bit secret for hash functions, ISN and hash table
* @conn_count: Count of total connections in connection table
- * @splice_conn_count: Count of spliced connections in connection table
* @port_to_tap: Ports bound host-side, packets to tap or spliced
* @fwd_in: Port forwarding configuration for inbound packets
* @fwd_out: Port forwarding configuration for outbound packets
@@ -67,7 +66,6 @@ union tcp_listen_epoll_ref {
struct tcp_ctx {
uint64_t hash_secret[2];
int conn_count;
- int splice_conn_count;
struct port_fwd fwd_in;
struct port_fwd fwd_out;
struct timespec timer_run;