diff options
author | Andi Kleen <ak@linux.intel.com> | 2014-03-31 08:07:46 -0700 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2014-06-13 13:15:28 -0700 |
commit | 8491ed6d70b60e4c75cdcfde10ae759898547b08 (patch) | |
tree | f26bd7e65ec2a860474297d5c8b87d49193ca4f2 /sysdeps/nptl | |
parent | a832bdd36203fcb37fa5ad25200ef3c1ae205efe (diff) | |
download | glibc-8491ed6d70b60e4c75cdcfde10ae759898547b08.tar.gz glibc-8491ed6d70b60e4c75cdcfde10ae759898547b08.tar.xz glibc-8491ed6d70b60e4c75cdcfde10ae759898547b08.zip |
Add adaptive elision to rwlocks
This patch relies on the C version of the rwlocks posted earlier. With C rwlocks it is very straight forward to do adaptive elision using TSX. It is based on the infrastructure added earlier for mutexes, but uses its own elision macros. The macros are fairly general purpose and could be used for other elision purposes too. This version is much cleaner than the earlier assembler based version, and in particular implements adaptation which makes it safer. I changed the behavior slightly to not require any changes in the test suite and fully conform to all expected behaviors (generally at the cost of not eliding in various situations). In particular this means the timedlock variants are not elided. Nested trylock aborts.
Diffstat (limited to 'sysdeps/nptl')
-rw-r--r-- | sysdeps/nptl/pthread.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index 40a3e215cc..682a1ae597 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -132,17 +132,17 @@ enum /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } + { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # ifdef __USE_GNU # ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ - 0, 0, 0, 0 } } + 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # else # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ |