From 0014077a369328f111a6600b412b753866e4b1e4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 26 Sep 2023 10:10:14 +0200 Subject: [PATCH] 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(). --- src/detect.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;