svn commit: r242002 - user/andre/tcp_workqueue/sys/sys
Andre Oppermann
andre at FreeBSD.org
Wed Oct 24 14:36:27 UTC 2012
Author: andre
Date: Wed Oct 24 14:36:26 2012
New Revision: 242002
URL: http://svn.freebsd.org/changeset/base/242002
Log:
Different approach to mutex alignment with a simple helper
macro MTX_ALIGN to insert the proper compiler specific and
architecture specific cache line alignment for global mutexes.
Modified:
user/andre/tcp_workqueue/sys/sys/mutex.h
Modified: user/andre/tcp_workqueue/sys/sys/mutex.h
==============================================================================
--- user/andre/tcp_workqueue/sys/sys/mutex.h Wed Oct 24 14:34:13 2012 (r242001)
+++ user/andre/tcp_workqueue/sys/sys/mutex.h Wed Oct 24 14:36:26 2012 (r242002)
@@ -399,6 +399,12 @@ do { \
* on SMP systems.
*/
#ifdef SMP
+#define MTX_ALIGN __aligned(CACHE_LINE_SIZE)
+#else
+#define MTX_ALIGN
+#endif
+
+#ifdef SMP
#define MTX_GLOBAL(name) \
struct mtx __aligned(CACHE_LINE_SIZE) (name)
#else /* SMP */
More information about the svn-src-user
mailing list