From dd037fb3df286b7c2d0b0c6f8d02a2dd8a8e8a08 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Tue, 20 Dec 2016 15:12:48 +0100 Subject: S390: Optimize lock-elision by decrementing adapt_count at unlock. This patch decrements the adapt_count while unlocking the futex instead of before aquiring the futex as it is done on power, too. Furthermore a transaction is only started if the futex is currently free. This check is done after starting the transaction, too. If the futex is not free and the transaction nesting depth is one, we can simply end the started transaction instead of aborting it. The implementation of this check was faulty as it always ended the started transaction. By using the fallback path, the the outermost transaction was aborted. Now the outermost transaction is aborted directly. This patch also adds some commentary and aligns the code in elision-trylock.c to the code in elision-lock.c as possible. ChangeLog: * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock_elision, lll_unlock_elision): Add adapt_count argument. * sysdeps/unix/sysv/linux/s390/elision-lock.c: (__lll_lock_elision): Decrement adapt_count while unlocking instead of before locking. * sysdeps/unix/sysv/linux/s390/elision-trylock.c (__lll_trylock_elision): Likewise. * sysdeps/unix/sysv/linux/s390/elision-unlock.c: (__lll_unlock_elision): Likewise. --- ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index a3742b5518..ee841a0d85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2016-12-20 Stefan Liebler + + * sysdeps/unix/sysv/linux/s390/lowlevellock.h + (__lll_unlock_elision, lll_unlock_elision): Add adapt_count argument. + * sysdeps/unix/sysv/linux/s390/elision-lock.c: + (__lll_lock_elision): Decrement adapt_count while unlocking + instead of before locking. + * sysdeps/unix/sysv/linux/s390/elision-trylock.c + (__lll_trylock_elision): Likewise. + * sysdeps/unix/sysv/linux/s390/elision-unlock.c: + (__lll_unlock_elision): Likewise. + 2016-12-20 Stefan Liebler * sysdeps/unix/sysv/linux/s390/htm.h(__libc_tbegin_retry): New macro. -- cgit v1.2.3