]> git.ipfire.org Git - thirdparty/suricata.git/commit
threading: set min thread stack size; set it early 9380/head 9381/head
authorVictor Julien <vjulien@oisf.net>
Thu, 10 Aug 2023 14:31:29 +0000 (16:31 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 11 Aug 2023 05:17:09 +0000 (07:17 +0200)
commitbecb8cefccc10c352184a9e8e930fd5fa9652651
tree13b9c5b3ad76478204d096a8ebfb4fee761c351f
parent92fce2fdc069324e6060ce046ca80da6a351573c
threading: set min thread stack size; set it early

Multi-tenancy uses loader threads that initialize detection engines. During
this, esp the AC family of MPM implementations, there is significant stack
usage. In most OS' threads have a lower stack size by default. In Linux, when
using the Musl C library, a thread by default gets 128KiB.

This patch does 2 things:

1. it centralizes the handling of the `threading.stack-size`. It it is not
   longer handled by the runmodes, but called from the global initialization
   logic.

2. it sets a minimum per thread stack size of 512k, unless `threading.stack-size`
   is set.

Ticket: #6265.
18 files changed:
src/runmode-af-packet.c
src/runmode-af-xdp.c
src/runmode-dpdk.c
src/runmode-erf-dag.c
src/runmode-erf-file.c
src/runmode-ipfw.c
src/runmode-napatech.c
src/runmode-netmap.c
src/runmode-nflog.c
src/runmode-nfq.c
src/runmode-pcap-file.c
src/runmode-pcap.c
src/runmode-pfring.c
src/runmode-windivert.c
src/runmodes.c
src/runmodes.h
src/suricata.c
src/tests/fuzz/fuzz_decodepcapfile.c