This is the mail archive of the libc-alpha@sourceware.org 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]

[RFC][PATCH] (Elision) Rename retry_try_xbegin to try_xbegin


The attached patch renames retry_try_xbegin in the elision_config
structure to try_xbegin and fixes the source code documentation.
It is actually not the number of _re_tries but the total number of
attempts using elision before using the lock.  The docuementation
suggested that (with the default values) one attempt plus three
retries would be made while in reality it were only three attempts
in total.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany
>From a9a6c67b9424235b7884771dca33bf0511ab0d24 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@de.ibm.com>
Date: Wed, 18 Sep 2013 08:54:26 +0000
Subject: [PATCH 1/7] x86: Rename retry_try_xbegin to try_xbegin which is more
 precise.

---
 nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c | 4 ++--
 nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h | 2 +-
 nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 2fed32b..ff0498f 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -35,10 +35,10 @@ struct elision_config __elision_aconf =
        to reasons other than other threads' memory accesses.  Expressed in
        number of lock acquisition attempts.  */
     .skip_lock_internal_abort = 3,
-    /* How often we retry using elision if there is chance for the transaction
+    /* How often we try using elision if there is chance for the transaction
        to finish execution (e.g., it wasn't aborted due to the lock being
        already acquired.  */
-    .retry_try_xbegin = 3,
+    .try_xbegin = 3,
     /* Same as SKIP_LOCK_INTERNAL_ABORT but for trylock.  */
     .skip_trylock_internal_abort = 3,
   };
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h
index 02cd2a6..6b36e29 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h
@@ -28,7 +28,7 @@ struct elision_config
 {
   int skip_lock_busy;
   int skip_lock_internal_abort;
-  int retry_try_xbegin;
+  int try_xbegin;
   int skip_trylock_internal_abort;
 };
 
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
index 7854057..65f5000 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
@@ -49,7 +49,7 @@ __lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
       unsigned status;
       int try_xbegin;
 
-      for (try_xbegin = aconf.retry_try_xbegin;
+      for (try_xbegin = aconf.try_xbegin;
 	   try_xbegin > 0;
 	   try_xbegin--)
 	{
-- 
1.7.11.4

Attachment: ChangeLog
Description: Text document


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