about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
Commit message (Collapse)AuthorAgeFilesLines
* nptl: Move elision implementations into libcFlorian Weimer2021-02-231-6/+1
| | | | | | | | | | | | | | | | | | The elision interfaces are closely aligned between the targets that implement them, so declare them in the generic <lowlevellock.h> file. Empty .c stubs are provided, so that fewer makefile updates under sysdeps are needed. Also simplify initialization via __libc_early_init. The symbols __lll_clocklock_elision, __lll_lock_elision, __lll_trylock_elision, __lll_unlock_elision, __pthread_force_elision move into libc. For the time being, non-hidden references are used from libpthread to access them, but once that part of libpthread is moved into libc, hidden symbols will be used again. (Hidden references seem desirable to reduce the likelihood of transactions aborts.)
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Remove support for PowerPC SPE extension (powerpc*-*-*gnuspe*).Zack Weinberg2019-05-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 9 dropped support for the SPE extensions to PowerPC, which means powerpc*-*-*gnuspe* configurations are no longer buildable with that compiler. This ISA extension was peculiar to the “e500” line of embedded PowerPC chips, which, as far as I can tell, are no longer being manufactured, so I think we should follow suit. This patch was developed by grepping for “e500”, “__SPE__”, and “__NO_FPRS__”, and may not eliminate every vestige of SPE support. Most uses of __NO_FPRS__ are left alone, as they are relevant to normal embedded PowerPC with soft-float. * sysdeps/powerpc/preconfigure: Error out on powerpc-*-*gnuspe* host type. * scripts/build-many-glibcs.py: Remove powerpc-*-linux-gnuspe and powerpc-*-linux-gnuspe-e500v1 from list of build configurations. * sysdeps/powerpc/powerpc32/e500: Recursively delete. * sysdeps/unix/sysv/linux/powerpc/powerpc32/e500: Recursively delete. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h: Delete. * sysdeps/powerpc/fpu_control.h: Remove SPE variant. Issue an #error if used with a compiler in SPE-float mode. * sysdeps/powerpc/powerpc32/__longjmp_common.S * sysdeps/powerpc/powerpc32/setjmp_common.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Remove code to preserve SPE register state. * sysdeps/unix/sysv/linux/powerpc/elision-lock.c * sysdeps/unix/sysv/linux/powerpc/elision-trylock.c * sysdeps/unix/sysv/linux/powerpc/elision-unlock.c Remove __SPE__ ifndefs.
* 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/+7
| | | | | | 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-2/+2
| | | | | | | 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: Fix usage of elision transient failure adapt paramPaul Murphy2015-10-271-9/+6
| | | | | | | | | | | | | | 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.
* 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: Revert to default atomic ops in elision codePaul E. Murphy2015-08-261-21/+0
| | | | | | | | | | | Power ISA 2.07B section B.5.5 relaxed the barrier requirement around a TLE enabled lock. It is now identical to a traditional lock. 2015-08-26 Paul E. Murphy <murphyp@linux.vnet.ibm.com> * sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__arch_compare_and_exchange_val_32_acq): Remove and use common definition. ISA 2.07B no longer requires full sync.
* 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/+107
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.