Make the spin lock struct 64-byte aligned to avoid false sharing issue.
Signed-off-by: William Tu <[email protected]>
---
include/openvswitch/thread.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/openvswitch/thread.h b/include/openvswitch/thread.h
index acc822904847..5053cb3091c3 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. */
};
--
2.7.4
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev