]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ovs-thread: Make struct spin lock cache aligned.
authorWilliam Tu <u9012063@gmail.com>
Mon, 26 Aug 2019 23:00:31 +0000 (16:00 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 28 Aug 2019 19:08:30 +0000 (12:08 -0700)
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>
include/openvswitch/thread.h

index acc822904847a3bc5146932477ccf6d7225fa306..5053cb3091c3192056cecbec9a7c13c52b493d87 100644 (file)
@@ -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. */
 };