From: Victor Julien Date: Tue, 26 Sep 2023 08:10:14 +0000 (+0200) Subject: detect: optimize struct layout X-Git-Tag: suricata-8.0.0-beta1~1948 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0014077a369328f111a6600b412b753866e4b1e4;p=thirdparty%2Fsuricata.git detect: optimize struct layout Move reference count to top of DetectEngineThreadCtx, to move it to the same cache line as the other members that are checked first in Detect(). --- diff --git a/src/detect.h b/src/detect.h index 9230f501d6..2b634e7617 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1082,6 +1082,8 @@ typedef struct DetectEngineThreadCtx_ { * on this being the first member */ uint32_t tenant_id; + SC_ATOMIC_DECLARE(int, so_far_used_by_detect); + /* the thread to which this detection engine thread belongs */ ThreadVars *tv; @@ -1157,8 +1159,6 @@ typedef struct DetectEngineThreadCtx_ { uint16_t alert_queue_capacity; PacketAlert *alert_queue; - SC_ATOMIC_DECLARE(int, so_far_used_by_detect); - /** array of signature pointers we're going to inspect in the detection * loop. */ Signature **match_array;