summaryrefslogtreecommitdiff
path: root/include/openvswitch
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2019-08-26 16:00:31 -0700
committerBen Pfaff <blp@ovn.org>2019-08-28 12:08:30 -0700
commitae36d63d7e3c9363e626c86e859ad6e2e2074b58 (patch)
tree298759c7cb5dbe239187df11a59fe71f57dfa6df /include/openvswitch
parentea41c034dbc76fccfef6ce71e8a4768d6eff0b3a (diff)
downloadopenvswitch-ae36d63d7e3c9363e626c86e859ad6e2e2074b58.tar.gz
ovs-thread: Make struct spin lock cache aligned.
Make the spin lock struct 64-byte aligned to avoid false sharing issue. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openvswitch')
-rw-r--r--include/openvswitch/thread.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/openvswitch/thread.h b/include/openvswitch/thread.h
index acc822904..5053cb309 100644
--- a/include/openvswitch/thread.h
+++ b/include/openvswitch/thread.h
@@ -34,7 +34,7 @@ struct OVS_LOCKABLE ovs_mutex {
};
#ifdef HAVE_PTHREAD_SPIN_LOCK
-struct OVS_LOCKABLE ovs_spin {
+OVS_ALIGNED_STRUCT(64, OVS_LOCKABLE ovs_spin) {
pthread_spinlock_t lock;
const char *where; /* NULL if and only if uninitialized. */
};