This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Elision, both for s390 and x86_64, should be enabled via --enable-lock-elision=yes.


All lock elision enablement should be controlled by the
--enable-lock-elision configure option.

I have already written to Andi about this, and he agreed
that it's OK for x86_64, and is what we agreed upon at
the global level for glibc.

Would you agree that this is also OK for s390?

The goal is to be able to enable or disable lock elision
for all architectures with a single configure option.

I understand that this is slightly different from what
we do for other features that we simply detect and use.

We do it this way for elision to give distributions the
flexibility because this feature is quite new and has potential
side-effects that perhaps might only be best enabled in a newer
version of the distribution.

It also gives users the ability to disable it if it's causing
problems for applications that are important to their use
cases, but that don't work well with elision.

In the long term I expect that runtime tunnables will be useful
in enabling or disabling elision on a per-application basis.

OK to commit for s390?

2014-09-29  Carlos O'Donell  <>

	* --enable-lock-elision enables or disables
	all elision for locks, not just mutexes.
	* configure: Regenerate.
	* sysdeps/unix/sysv/linux/s390/elision-conf.c (elision_init)
	[!ENABLE_LOCK_ELISION]: Set __pthread_force_elision to zero.
	* sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init)
	[!ENABLE_LOCK_ELISION]: Set __pthread_force_elision,
	__elision_available, and __elision_aconf.retry_try_xbegin to zero.

diff --git a/configure b/configure
index 89566c5..9a9cf08 100755
--- a/configure
+++ b/configure
@@ -1413,7 +1413,7 @@ Optional Features:
                           initialize __stack_chk_guard canary with a random
                           number at program start
-                          Enable lock elision for pthread mutexes by default
+                          Enable hardware lock elision by default
                           configure and build add-ons in DIR1,DIR2,... search
                           for add-ons if no parameter given
diff --git a/ b/
index 82d0896..d113772 100644
--- a/
+++ b/
@@ -169,7 +169,7 @@ fi
-			     [Enable lock elision for pthread mutexes by default]),
+			     [Enable hardware lock elision by default]),
diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.c b/sysdeps/unix/sysv/linux/s390/elision-conf.c
index 69c0483..852433e 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-conf.c
@@ -60,11 +60,16 @@ elision_init (int argc __attribute__ ((unused)),
 	      char **argv  __attribute__ ((unused)),
 	      char **environ)
   /* Set when the CPU and the kernel supports transactional execution.
      When false elision is never attempted.  */
   int elision_available = (GLRO (dl_hwcap) & HWCAP_S390_TE) ? 1 : 0;
   __pthread_force_elision = __libc_enable_secure ? 0 : elision_available;
+  /* This configuration has elision disabled.  */
+  __pthread_force_elision = 0;
 #ifdef SHARED
diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 28e48d9..abc42b7 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -62,12 +62,17 @@ elision_init (int argc __attribute__ ((unused)),
 	      char **argv  __attribute__ ((unused)),
 	      char **environ)
-  __elision_available = HAS_RTM;
+  __elision_available = HAS_RTM;
   __pthread_force_elision = __libc_enable_secure ? 0 : __elision_available;
   if (!HAS_RTM)
-    __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks */
+    __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks.  */
+  /* This configuration has elision disabled.  */
+  __elision_available = 0;
+  __pthread_force_elision = 0;
+  __elision_aconf.retry_try_xbegin = 0;
 #ifdef SHARED

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]