Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2012 14:36:26 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r242002 - user/andre/tcp_workqueue/sys/sys
Message-ID:  <201210241436.q9OEaQpB033465@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210241436.q9OEaQpB033465>