aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorPaul Murphy <murphyp@linux.vnet.ibm.com>2015-08-27 09:48:04 -0500
committerMike Frysinger <vapier@gentoo.org>2016-01-24 03:53:53 -0500
commit23f12d0a815e55ab60a0e6d973fc3f4730ca6980 (patch)
tree178ee661464334f79e2ee060f335ad6b6e2bd574 /sysdeps/powerpc
parentb84ee767b4303b77a5a284b2d03f56c98d89263c (diff)
downloadglibc-23f12d0a815e55ab60a0e6d973fc3f4730ca6980.tar
glibc-23f12d0a815e55ab60a0e6d973fc3f4730ca6980.tar.gz
glibc-23f12d0a815e55ab60a0e6d973fc3f4730ca6980.tar.bz2
glibc-23f12d0a815e55ab60a0e6d973fc3f4730ca6980.zip
powerpc: Fix usage of elision transient failure adapt param
The skip_lock_out_of_tbegin_retries adaptive parameter was not being used correctly, nor as described. This prevents a fallback for all users of the lock if a transient abort occurs within the accepted number of retries. [BZ #19174] * sysdeps/powerpc/nptl/elide.h (__elide_lock): Fix usage of .skip_lock_out_of_tbegin_retries. * sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision): Likewise, and respect a value of try_tbegin <= 0. (cherry picked from commit 72f1463df85a522bfd1568e47bd81371522ee358) Conflicts: NEWS (cherry picked from commit cd51b1424477652cccdb83e7a95644d198fd4513)
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/nptl/elide.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index 12171f45dc..2e1e443278 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -27,7 +27,7 @@
configurations. Returns true if the system should retry again or false
otherwise. */
static inline bool
-__get_new_count (uint8_t *adapt_count)
+__get_new_count (uint8_t *adapt_count, int attempt)
{
/* A persistent failure indicates that a retry will probably
result in another failure. Use normal locking now and
@@ -40,7 +40,7 @@ __get_new_count (uint8_t *adapt_count)
}
/* Same logic as above, but for a number of temporary failures in a
a row. */
- else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
+ else if (attempt <= 1 && __elision_aconf.skip_lock_out_of_tbegin_retries > 0
&& __elision_aconf.try_tbegin > 0)
*adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
return true;
@@ -78,7 +78,7 @@ __get_new_count (uint8_t *adapt_count)
__builtin_tabort (_ABORT_LOCK_BUSY); \
} \
else \
- if (!__get_new_count(&adapt_count)) \
+ if (!__get_new_count (&adapt_count,i)) \
break; \
} \
ret; \