about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2013-05-16 19:17:14 -0700
committerAndi Kleen <ak@linux.intel.com>2013-07-02 08:46:55 -0700
commit1717da59aed9612becd56aaa1249aac695af4c8a (patch)
tree0b69e8ee62804482fd7bd951c918abdd9d15c0a3 /nptl
parent49186d21ef2d87986bccaf0a7c45c48c91b265f3 (diff)
downloadglibc-1717da59aed9612becd56aaa1249aac695af4c8a.tar.gz
glibc-1717da59aed9612becd56aaa1249aac695af4c8a.tar.xz
glibc-1717da59aed9612becd56aaa1249aac695af4c8a.zip
Add a configure option to enable lock elision and disable by default
Can be enabled with --enable-lock-elision=yes at configure time.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index d32046ee65..46cf30849f 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-02  Andi Kleen <ak@linux.intel.com>
+
+	* sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
+	  Check ENABLE_LOCK_ELISION.
+
 2013-07-02  Andi Kleen  <ak@linux.intel.com>
 
 	* pthread_mutexattr_settype.c (__pthread_mutexattr_settype):
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 6277e48d76..118cfa72f5 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>. */
 
+#include "config.h"
 #include <pthreadP.h>
 #include <init-arch.h>
 #include <elision-conf.h>
@@ -70,8 +71,10 @@ elision_init (int argc __attribute__ ((unused)),
 	      char **environ)
 {
   __elision_available = HAS_RTM;
+#ifdef ENABLE_LOCK_ELISION
   __pthread_force_elision = __libc_enable_secure ? 0 : __elision_available;
   __rwlock_rtm_enabled = __libc_enable_secure ? 0 : __elision_available;
+#endif
 }
 
 #ifdef SHARED