summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64
AgeCommit message (Collapse)AuthorFilesLines
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae32-32/+32
2013-09-04Remove --disable-versioning.Joseph Myers1-1/+1
2013-07-02Add the low level infrastructure for pthreads lock elision with TSXAndi Kleen1-0/+23
Lock elision using TSX is a technique to optimize lock scaling It allows to run locks in parallel using hardware support for a transactional execution mode in 4th generation Intel Core CPUs. See http://www.intel.com/software/tsx for more Information. This patch implements a simple adaptive lock elision algorithm based on RTM. It enables elision for the pthread mutexes and rwlocks. The algorithm keeps track whether a mutex successfully elides or not, and stops eliding for some time when it is not. When the CPU supports RTM the elision path is automatically tried, otherwise any elision is disabled. The adaptation algorithm and its tuning is currently preliminary. The code adds some checks to the lock fast paths. Micro-benchmarks show little to no difference without RTM. This patch implements the low level "lll_" code for lock elision. Followon patches hook this into the pthread implementation Changes with the RTM mutexes: ----------------------------- Lock elision in pthreads is generally compatible with existing programs. There are some obscure exceptions, which are expected to be uncommon. See the manual for more details. - A broken program that unlocks a free lock will crash. There are ways around this with some tradeoffs (more code in hot paths) I'm still undecided on what approach to take here; have to wait for testing reports. - pthread_mutex_destroy of a lock mutex will not return EBUSY but 0. - There's also a similar situation with trylock outside the mutex, "knowing" that the mutex must be held due to some other condition. In this case an assert failure cannot be recovered. This situation is usually an existing bug in the program. - Same applies to the rwlocks. Some of the return values changes (for example there is no EDEADLK for an elided lock, unless it aborts. However when elided it will also never deadlock of course) - Timing changes, so broken programs that make assumptions about specific timing may expose already existing latent problems. Note that these broken programs will break in other situations too (loaded system, new faster hardware, compiler optimizations etc.) - Programs with non recursive mutexes that take them recursively in a thread and which would always deadlock without elision may not always see a deadlock. The deadlock will only happen on an early or delayed abort (which typically happens at some point) This only happens for mutexes not explicitely set to PTHREAD_MUTEX_NORMAL or PTHREAD_MUTEX_ADAPTIVE_NP. PTHREAD_MUTEX_NORMAL mutexes do not elide. The elision default can be set at configure time. This patch implements the basic infrastructure for elision.
2013-06-10x86*: Return syscall error for lll_futex_wake.Carlos O'Donell1-4/+5
It is very very possible that the futex syscall returns an error and that the caller of lll_futex_wake may want to look at that error and propagate the failure. This patch allows a caller to see the syscall error. There are no users of the syscall error at present, but future cleanups are now be able to check for the error. -- nplt/ 2013-06-10 Carlos O'Donell <carlos@redhat.com> * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wake): Return syscall error. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wake): Return syscall error.
2013-04-04Fix static build when configured with --disable-hidden-pltSiddhesh Poyarekar1-1/+1
Fixes BZ #15337. Static builds fail with the following warning: /home/tools/glibc/glibc/nptl/../nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S:80: undefined reference to `__GI___pthread_unwind' When the source is configured with --disable-hidden-plt. This is because the preprocessor conditional in cancellation.S only checks if the build is for SHARED, whereas hidden_def is defined appropriately only for a SHARED build that will have symbol versioning *and* hidden defs are enabled. The last case is false here.
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers32-33/+32
2013-01-01Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers1-1/+1
2012-10-16Adjust mutex lock in condvar_cleanup if we got it from requeue_piSiddhesh Poyarekar2-2/+9
This completes the fix to bz #14652.
2012-10-10Take lock in pthread_cond_wait cleanup handler only when neededSiddhesh Poyarekar2-4/+32
[BZ #14652] When a thread waiting in pthread_cond_wait with a PI mutex is cancelled after it has returned successfully from the futex syscall but just before async cancellation is disabled, it enters its cancellation handler with the mutex held and simply calling a mutex_lock again will result in a deadlock. Hence, it is necessary to see if the thread owns the lock and try to lock it only if it doesn't.
2012-10-05Unlock mutex before going back to waiting for PI mutexesSiddhesh Poyarekar2-84/+88
[BZ #14417] A futex call with FUTEX_WAIT_REQUEUE_PI returns with the mutex locked on success. If such a successful thread is pipped to the cond_lock by another spuriously woken waiter, it could be sent back to wait on the futex with the mutex lock held, thus causing a deadlock. So it is necessary that the thread relinquishes the mutex before going back to sleep.
2012-10-02Fix clone flag name in comment to CLONE_CHILD_CLEARTID.Siddhesh Poyarekar1-1/+1
2012-08-16Remove __ASSUME_POSIX_TIMERS.Joseph Myers1-30/+0
2012-07-25Remove unused pseudo_end labelAndreas Schwab1-3/+2
2012-05-30Use x86-64 bits/pthreadtypes.h/semaphore.h for i386/x86-64H.J. Lu3-280/+1
2012-05-30Remove use of INTDEF/INTUSE in nptlAndreas Schwab4-22/+10
2012-05-25Add systemtap static probe points in generic and x86_64 pthread code.Roland McGrath8-27/+49
2012-05-15Use R*_LP to load pointer and operate on stackH.J. Lu1-31/+32
2012-05-15Use LP_OP(cmp) and RCX_LP on dep_mutex pointerH.J. Lu1-4/+4
2012-05-15Use LP_OP(op), LP_SIZE and ASM_ADDR in sem_wait.SH.J. Lu1-6/+6
2012-05-15se LP_OP(op), LP_SIZE and ASM_ADDR in sem_timedwait.SH.J. Lu1-9/+9
2012-05-15Use LP_OP(cmp) on NWAITERSH.J. Lu1-1/+1
2012-05-15Use LP_SIZE and ASM_ADDR in pthread_once.SH.J. Lu1-3/+3
2012-05-15Use LP_OP(cmp), R*_LP, LP_SIZE and ASM_ADDRH.J. Lu1-20/+20
2012-05-15Use LP_OP(cmp), R*_LP, LP_SIZE and ASM_ADDRH.J. Lu1-24/+24
2012-05-15Use LP_OP(cmp) and RCX_LP on dep_mutex pointerH.J. Lu1-6/+6
2012-05-15Use LP_OP(mov) and RDI_LP on pointerH.J. Lu1-3/+3
2012-05-15Use LP_SIZE and load timeout pointer into RDX_LPH.J. Lu1-4/+4
2012-05-14Add x32 pthread typesH.J. Lu1-14/+27
2012-05-11Check __x86_64__ for __cleanup_fct_attributeH.J. Lu1-1/+1
2012-03-19Use __NR_futex to define SYS_futexH.J. Lu1-1/+1
2012-02-27Fix stray references to __pthread_attrDavid S. Miller1-1/+1
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Don't refer to non-existing __pthread_attr. * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2012-02-26Fix name mangling of pthread_attr_t after changeUlrich Drepper1-1/+1
2012-02-26Work around problem of pthread_attr_t definition with old compilersUlrich Drepper1-2/+6
2012-02-26Fix up POSIX testing in conformtestUlrich Drepper1-3/+2
2012-02-15Remove unused Makefile.Marek Polacek1-4/+0
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert34-102/+68
2011-11-30Handle EAGAIN from FUTEX_WAIT_REQUEUE_PIAndreas Schwab1-2/+74
2011-10-29Add missing register initialization in x86-64 pthread_cond_timedwaitUlrich Drepper1-3/+3
2011-09-10Remove support for !USE___THREADUlrich Drepper4-48/+3
2011-09-08Fix macro used in testH.J. Lu1-1/+1
2011-09-07Remove gettimeofday vsyscall use from x86-86 libpthreadUlrich Drepper5-45/+29
2011-09-06Don't call gettimeofday vsyscall in x86-64 sem_timedwaitUlrich Drepper1-8/+5
2011-08-09Fix stack alignment on x86_64Andreas Schwab3-7/+9
2010-07-01Work around kernel rejecting valid absolute timestampsAndreas Schwab6-7/+45
2009-11-27Fix infloop in __pthread_disable_asynccancel on x86_64Andreas Schwab1-2/+3
2009-11-17Minimal unwind section size reduction.Ulrich Drepper1-17/+14
2009-08-22Rvert accidental checkins.Ulrich Drepper5-545/+0
2009-08-22Add sigstack handling to Linux ____longjmp_chk on powerpc.Andreas Schwab5-0/+545
2009-08-11Add CFI directives to x86-64 pthread_rwlock_unlock.Ulrich Drepper1-2/+3
2009-08-10Add CFI directives to x86-64 pthread_rwlock_{rd,wr)lock.Ulrich Drepper2-2/+6