]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Align some structures to cacheline
authorKen Steele <ken@tilera.com>
Wed, 11 Sep 2013 20:47:27 +0000 (16:47 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 09:56:12 +0000 (11:56 +0200)
Align strucutres with pthread mutex locks to start on cachelines to keep
the lock within one cacheline.

src/data-queue.h
src/flow-hash.h
src/host.h

index 0ba66506749886737c8dd49150266e10c0317167..f1f6bb3839656d34e92dedaad68052e990d81ab1 100644 (file)
@@ -56,7 +56,7 @@ typedef struct SCDQDataQueue_ {
     SCMutex mutex_q;
     SCCondT cond_q;
 
-} SCDQDataQueue;
+} __attribute__((aligned(CLS))) SCDQDataQueue;
 
 void SCDQDataEnqueue(SCDQDataQueue *, SCDQGenericQData *);
 SCDQGenericQData *SCDQDataDequeue(SCDQDataQueue *);
index 171c527f06b7690c271feb11c3ab202d6d2df8e5..3279f80113d7e1afb0220c83679ddcb360c530db 100644 (file)
@@ -48,7 +48,7 @@ typedef struct FlowBucket_ {
 #else
     #error Enable FBLOCK_SPIN or FBLOCK_MUTEX
 #endif
-} FlowBucket;
+} __attribute__((aligned(CLS))) FlowBucket;
 
 #ifdef FBLOCK_SPIN
     #define FBLOCK_INIT(fb) SCSpinInit(&(fb)->s, 0)
index 0f35b18d235a792b892b2a70f04dc91eabe47f53..9f8d0c5dd2f87f294849fe2c2ed351a7c458403c 100644 (file)
@@ -84,7 +84,7 @@ typedef struct HostHashRow_ {
     HRLOCK_TYPE lock;
     Host *head;
     Host *tail;
-} HostHashRow;
+} __attribute__((aligned(CLS))) HostHashRow;
 
 /** host hash table */
 HostHashRow *host_hash;