]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threading/threadvars: optimize layout
authorVictor Julien <victor@inliniac.net>
Wed, 13 Nov 2019 10:39:44 +0000 (11:39 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 14:43:10 +0000 (15:43 +0100)
Make sure StatsPublicThreadContext is on its own cache line.

src/threadvars.h

index 3c18f64e5d857b80a1f6efc4cb1d2d5ef5e6913c..ccf84960f9ffe024acf14e8e53113c73c6eecd23 100644 (file)
@@ -119,6 +119,9 @@ typedef struct ThreadVars_ {
     /** private counter store: counter updates modify this */
     StatsPrivateThreadContext perf_private_ctx;
 
+    /** pointer to the next thread */
+    struct ThreadVars_ *next;
+
     /** public counter store: counter syncs update this */
     StatsPublicThreadContext perf_public_ctx;
 
@@ -127,9 +130,6 @@ typedef struct ThreadVars_ {
     SCCtrlMutex *ctrl_mutex;
     SCCtrlCondT *ctrl_cond;
 
-    /** pointer to the next thread */
-    struct ThreadVars_ *next;
-
 } ThreadVars;
 
 /** Thread setup flags: */