diff options
author | Stefan Liebler <stli@linux.vnet.ibm.com> | 2017-01-20 09:53:04 +0100 |
---|---|---|
committer | Stefan Liebler <stli@linux.vnet.ibm.com> | 2017-01-20 09:53:04 +0100 |
commit | 03b007771beb4dba3b16d6097a53bfa328a78efb (patch) | |
tree | 0c3a5e1b2fe7012e55534cbc997426d2aff1d8f6 /sysdeps/unix/sysv/linux/s390/htm.h | |
parent | 56009aa33c735d66f19d8382b6ef7c6addc24ec0 (diff) | |
download | glibc-03b007771beb4dba3b16d6097a53bfa328a78efb.zip glibc-03b007771beb4dba3b16d6097a53bfa328a78efb.tar.gz glibc-03b007771beb4dba3b16d6097a53bfa328a78efb.tar.bz2 |
S390: Adjust lock elision code after review.
This patch adjusts s390 specific lock elision code after review
of the following patches:
-S390: Use own tbegin macro instead of __builtin_tbegin.
(8bfc4a2ab4bebdf86c151665aae8a266e2f18fb4)
-S390: Use new __libc_tbegin_retry macro in elision-lock.c.
(53c5c3d5ac238901c13f28a73ba05b0678094e80)
-S390: Optimize lock-elision by decrementing adapt_count at unlock.
(dd037fb3df286b7c2d0b0c6f8d02a2dd8a8e8a08)
The futex value is not tested before starting a transaction,
__glibc_likely is used instead of __builtin_expect and comments
are adjusted.
ChangeLog:
* sysdeps/unix/sysv/linux/s390/htm.h: Adjust comments.
* sysdeps/unix/sysv/linux/s390/elision-unlock.c: Likewise.
* sysdeps/unix/sysv/linux/s390/elision-lock.c: Adjust comments.
(__lll_lock_elision): Do not test futex before starting a
transaction. Use __glibc_likely instead of __builtin_expect.
* sysdeps/unix/sysv/linux/s390/elision-trylock.c: Adjust comments.
(__lll_trylock_elision): Do not test futex before starting a
transaction. Use __glibc_likely instead of __builtin_expect.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/htm.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/htm.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/htm.h b/sysdeps/unix/sysv/linux/s390/htm.h index 32d5a88..70d7f66 100644 --- a/sysdeps/unix/sysv/linux/s390/htm.h +++ b/sysdeps/unix/sysv/linux/s390/htm.h @@ -119,11 +119,16 @@ ar modification and fp operations. Some \ program-interruptions (e.g. a null \ pointer access) are filtered and the \ - trancsaction will abort. In this case \ + transaction will abort. In this case \ the normal lock path will execute it \ again and result in a core dump wich does \ now show at tbegin but the real executed \ - instruction. */ \ + instruction. \ + However it is not guaranteed that this \ + retry operate on the same data and thus \ + may not end in an program-interruption. \ + Note: This could also be used to probe \ + memory for being accessible! */ \ "2: tbegin 0, 0xFF0E\n\t" \ /* Branch away in abort case (this is the \ prefered sequence. See PoP in chapter 5 \ @@ -152,7 +157,8 @@ __ret; \ }) -/* These builtins are correct. Use them. */ +/* These builtins are usable in context of glibc lock elision code without any + changes. Use them. */ #define __libc_tend() \ ({ __asm__ __volatile__ (".machine push\n\t" \ ".machinemode \"zarch_nohighgprs\"\n\t" \ |