This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 01/11] Add the low level infrastructure for pthreads lock elision with TSX
- From: Andi Kleen <andi at firstfloor dot org>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Andi Kleen <andi at firstfloor dot org>, libc-alpha at sourceware dot org, Andi Kleen <ak at linux dot jf dot intel dot com>, Torvald Riegel <triegel at redhat dot com>
- Date: Tue, 25 Jun 2013 07:09:26 +0200
- Subject: Re: [PATCH 01/11] Add the low level infrastructure for pthreads lock elision with TSX
- References: <1372098290-29147-1-git-send-email-andi at firstfloor dot org> <1372098290-29147-2-git-send-email-andi at firstfloor dot org> <51C915A8 dot 6070902 at redhat dot com>
Here's a patch adding the requested comments to elision-conf
-Andi
[PATCH] fixup! Add the low level infrastructure for pthreads lock elision with TSX
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 39ea383..045f98e 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -23,6 +23,9 @@
#include <elision-conf.h>
#include <glibc-var.h>
+/* Reasonable initial tuning values, may be revised in the future.
+ This is a conservative initial value. */
+
struct elision_config __elision_aconf =
{
.skip_lock_busy = 3,
@@ -110,19 +113,23 @@ elision_aconf_setup (const char *s)
}
}
-/* Elided rwlock toggle. */
+/* Elided rwlock toggle, set when elision is available and is
+ enabled for rwlocks. */
int __rwlock_rtm_enabled attribute_hidden;
-/* Retries for elided rwlocks. */
+/* Retries for elided rwlocks on read. Conservative initial value. */
int __rwlock_rtm_read_retries attribute_hidden = 3;
-/* Global elision check switch. */
+/* Set when the CPU supports elision. When false elision is never attempted. */
int __elision_available attribute_hidden;
-/* Force elision for all new locks. */
+/* Force elision for all new locks. This is used to decide whether existing
+ DEFAULT locks should be automatically upgraded to elision in
+ pthread_mutex_lock(). Disabled for suid programs. Only used when elision
+ is available. */
int __pthread_force_elision attribute_hidden;
--
ak@linux.intel.com -- Speaking for myself only.