summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* powerpc: Fix TLE build for SPE (BZ #22926)Adhemerval Zanella2018-03-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some SPE opcodes clashes with some recent PowerISA opcodes and until recently gas did not complain about it. However binutils recently changed it and now VLE configured gas does not support to assembler some instruction that might class with VLE (HTM for instance). It also does not help that glibc build hardware lock elision support as default (regardless of assembler support). Although runtime will not actually enables TLE on SPE hardware (since kernel will not advertise it), I see little advantage on adding HTM support on SPE built glibc. SPE uses an incompatible ABI which does not allow share the same build with default powerpc and HTM code slows down SPE without any benefict. This patch fixes it by only building HTM when SPE configuration is not used. Checked with a powerpc-linux-gnuspe build. I also did some sniff tests on a e500 hardware without any issue. [BZ #22926] * sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Define empty for __SPE__. * sysdeps/powerpc/sysdep.h (ABORT_TRANSACTION): Likewise. * sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision): Do not build hardware transactional code for __SPE__. * sysdeps/unix/sysv/linux/powerpc/elision-trylock.c (__lll_trylock_elision): Likewise. * sysdeps/unix/sysv/linux/powerpc/elision-unlock.c (__lll_unlock_elision): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* powerpc: Fix write-after-destroy in lock elision [BZ #20822]Tulio Magno Quites Machado Filho2017-01-031-3/+4
| | | | | | The update of *adapt_count after the release of the lock causes a race condition when thread A unlocks, thread B continues and destroys the mutex, and thread A writes to *adapt_count.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* powerpc: Enforce compiler barriers on hardware transactionsTulio Magno Quites Machado Filho2016-01-081-3/+3
| | | | | | | Work around a GCC behavior with hardware transactional memory built-ins. GCC doesn't treat the PowerPC transactional built-ins as compiler barriers, moving instructions past the transaction boundaries and altering their atomicity.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* powerpc: More elision improvementsPaul Murphy2015-11-191-5/+6
| | | | | | | | | | | | | | | | | | | | | | | __lll_trylock_elision sets the adapt_count variable too aggressively, and incorrectly on persistent aborts. Taking a cue from s390, adapt_count is only updated if the lock is locked, or a persistent failure occurs. In addition, the abort codes have been renumbered and refactored for clarity. As it stands, glibc only cares if the abort is persistent or not. All aborts are now persistent, excepting a busy lock. This includes changing _ABORT_NESTED_TRYLOCK into a persistent abort. * sysdeps/unix/sysv/linux/powerpc/elision-trylock.c (__lll_trylock_elision): Fix setting of adapt_count. * sysdeps/unix/sysv/linux/powerpc/htm.h (_ABORT_PERSISTENT): Define to clarify persistent aborts. (_ABORT_NESTED_TRYLOCK): Renumber, and make persistent. (_ABORT_SYSCALL): Renumber, and clarify definition. (_ABORT_LOCK_BUSY): Renumber, make non-persistent.
* powerpc: Optimize lock elision for pthread_mutex_tPaul Murphy2015-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | With TLE enabled, the adapt count variable update incurs an 8% overhead before entering the critical section of an elided mutex. Instead, if it is done right after leaving the critical section, this serialization can be avoided. This alters the existing behavior of __lll_trylock_elision as it will only decrement the adapt_count if it successfully acquires the lock. * sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision): Remove adapt_count decrement... * sysdeps/unix/sysv/linux/powerpc/elision-trylock.c (__lll_trylock_elision): Likewise. * sysdeps/unix/sysv/linux/powerpc/elision-unlock.c (__lll_unlock_elision): ... to here. And utilize new adapt_count parameter. * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_unlock_elision): Update to include adapt_count parameter. (lll_unlock_elision): Pass pointer to adapt_count variable.
* powerpc: Fix Copyright dates and CL entryAdhemerval Zanella2015-01-121-1/+1
| | | | | This patch fixes the copyright dates from files created by commit 8d2c0a5, 4b45943, and 56cf276.
* powerpc: Add the lock elision using HTMAdhemerval Zanella2015-01-121-0/+68
This patch adds support for lock elision using ISA 2.07 hardware transactional memory instructions for pthread_mutex primitives. Similar to s390 version, the for elision logic defined in 'force-elision.h' is only enabled if ENABLE_LOCK_ELISION is defined. Also, the lock elision code should be able to be built even with a compiler that does not provide HTM support with builtins. However I have noted the performance is sub-optimal due scheduling pressures.