From: Ken Steele Date: Wed, 11 Sep 2013 20:47:27 +0000 (-0400) Subject: Align some structures to cacheline X-Git-Tag: suricata-2.0beta2~378 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=62540eff3ed96ee4cac0697374831ef1aff34855;p=thirdparty%2Fsuricata.git Align some structures to cacheline Align strucutres with pthread mutex locks to start on cachelines to keep the lock within one cacheline. --- diff --git a/src/data-queue.h b/src/data-queue.h index 0ba6650674..f1f6bb3839 100644 --- a/src/data-queue.h +++ b/src/data-queue.h @@ -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 *); diff --git a/src/flow-hash.h b/src/flow-hash.h index 171c527f06..3279f80113 100644 --- a/src/flow-hash.h +++ b/src/flow-hash.h @@ -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) diff --git a/src/host.h b/src/host.h index 0f35b18d23..9f8d0c5dd2 100644 --- a/src/host.h +++ b/src/host.h @@ -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;