]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: optimize struct layout
authorVictor Julien <vjulien@oisf.net>
Tue, 26 Sep 2023 08:10:14 +0000 (10:10 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 7 Dec 2023 08:56:59 +0000 (09:56 +0100)
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().

src/detect.h

index 9230f501d697d846b33e5db4e50fe0661883d89c..2b634e76170176f97c1b6b3f56bc8445749c18ee 100644 (file)
@@ -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;