summaryrefslogtreecommitdiff
path: root/build_posix
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-08-28 14:34:01 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-08-28 14:34:01 -0400
commitb9131073d0077e78eab9478a424594804f9ac963 (patch)
treee94ca2fc06f25d261f7de19a913c1ab80e494ac8 /build_posix
parent788f49cfa8ad8c839e878bd96ad42033c6dea32c (diff)
downloadmongo-b9131073d0077e78eab9478a424594804f9ac963.tar.gz
Switch from adaptive pthread mutexes by default, based on:
http://smalldatum.blogspot.com/2014/08/the-innodb-mutex.html There's more information here: http://stackoverflow.com/questions/19863734/what-is-pthread-mutex-adaptive-np Add a new option, --pthread_adaptive to configure adaptive mutexes. Don't list --pthread-logging in the --with-spinlock=XXX configure usage message, that's not for public use. Add a tuning page that talks about mutex choice.
Diffstat (limited to 'build_posix')
-rw-r--r--build_posix/aclocal/options.m44
-rw-r--r--build_posix/configure.ac.in10
2 files changed, 3 insertions, 11 deletions
diff --git a/build_posix/aclocal/options.m4 b/build_posix/aclocal/options.m4
index 54933130b05..2682c8ea82c 100644
--- a/build_posix/aclocal/options.m4
+++ b/build_posix/aclocal/options.m4
@@ -172,13 +172,15 @@ AH_TEMPLATE(SPINLOCK_TYPE, [Spinlock type from mutex.h.])
AC_MSG_CHECKING(if --with-spinlock option specified)
AC_ARG_WITH(spinlock,
[AS_HELP_STRING([--with-spinlock],
- [Spinlock type (pthread, pthread_logging or gcc).])],
+ [Spinlock type (pthread, pthread_adaptive or gcc).])],
[],
[with_spinlock=pthread])
case "$with_spinlock" in
gcc) AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_GCC);;
pthread|pthreads)
AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX);;
+pthread_adaptive|pthreads_adaptive)
+ AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX_ADAPTIVE);;
pthread_logging|pthreads_logging)
AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX_LOGGING);;
*) AC_MSG_ERROR([Unknown spinlock type "$with_spinlock"]);;
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in
index 4905cd45e26..dd5bce738ea 100644
--- a/build_posix/configure.ac.in
+++ b/build_posix/configure.ac.in
@@ -87,16 +87,6 @@ AS_CASE([$host_os], [darwin*], [], [AC_CHECK_FUNCS([fdatasync])])
AC_SYS_LARGEFILE
-AC_MSG_CHECKING([if the adaptive mutex type is available])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],[[
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);]])],
- [AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_MUTEX_ADAPTIVE], [1],
- [Define if adaptive mutexes are supported.])],
- [AC_MSG_RESULT([no])])
-
AC_C_BIGENDIAN
# Linux requires _GNU_SOURCE to be defined