]> git.ipfire.org Git - thirdparty/suricata.git/commit
threads: give threads more time to get ready 11181/head 11202/head
authorVictor Julien <vjulien@oisf.net>
Wed, 29 May 2024 05:03:24 +0000 (07:03 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 30 May 2024 07:38:04 +0000 (09:38 +0200)
commitf3b2e9618d81147909d9815d7503ba6f33babcc0
tree89cf1ef7bc1fbdcee524a55106729fec4e32a3b5
parent183a6f20d235f9ad0c7ff9beafac0043b39faa13
threads: give threads more time to get ready

In certain conditions, it can take a long time for threads to start up.
For example in af-packet, setting up the socket, rings, etc has been
observed to take close to half a second per thread, and since the
threads go one by one in a preset order, this means the start up can
take a lot of time if there are many threads. The old logic would just
allow a hard coded 60s. This was not always enough when the number of
threads was high.

This patch makes the wait time take the number of threads into account.
It adds a second of time budget to the base 60s for each thread.

So as an example, if a system has 112 af-packet threads, it would wait
172 seconds (60 + 112) for the threads to get ready.

Ticket: #7048.
(cherry picked from commit 41b9836b11bbd653953f5c5dc5f87875e15fae8d)
src/tm-threads.c