summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/i386
AgeCommit message (Collapse)AuthorFilesLines
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae60-60/+60
2013-12-09Fix CFI annotations in pthread_cond_timedwait for i486+Andreas Schwab1-2/+1
2013-07-02Add the low level infrastructure for pthreads lock elision with TSXAndi Kleen1-0/+22
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-06-06Remove trailing whitespace in nptl.Joseph Myers1-1/+1
2013-04-11Extend i486 pthread_cond_timedwait to use futex syscall with absolute timeoutAndreas Schwab1-66/+315
2013-03-04Rejigger i386 dl-sysdep.h files.Roland McGrath2-50/+31
2013-01-10Revert "Extend i486 pthread_cond_timedwait to use futex syscall with ↵Andreas Schwab1-315/+66
absolute timeout" This reverts commit 1bd57044e963abb886cb912beadea714815a3d5c.
2013-01-10Extend i486 pthread_cond_timedwait to use futex syscall with absolute timeoutAndreas Schwab1-66/+315
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to directly use absolute timeout.
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers60-61/+60
2012-10-16Adjust mutex lock in condvar_cleanup if we got it from requeue_piSiddhesh Poyarekar2-2/+8
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-87/+68
[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-10-01Fix exception table for i386 pthread_cond_waitSiddhesh Poyarekar2-2/+22
[BZ #14477] Add an additional entry in the exception table to jump to __condvar_w_cleanup2 instead of __condvar_w_cleanup for PI mutexes when %ebx contains the address of the futex instead of the condition variable.
2012-08-16Remove __ASSUME_POSIX_TIMERS.Joseph Myers1-28/+0
2012-07-25Remove unused pseudo_end labelAndreas Schwab2-5/+3
2012-05-30Use x86-64 bits/pthreadtypes.h/semaphore.h for i386/x86-64H.J. Lu3-211/+1
2012-05-30Remove use of INTDEF/INTUSE in nptlAndreas Schwab4-22/+10
2012-05-25i386 port of the pthread SystemTap probesRayson Ho8-12/+33
2012-05-17Fix warnings on Linux/i686Andreas Jaeger1-4/+2
Fixes: ../sysdeps/i386/dl-machine.h:336:30: warning: unused variable ‘refsym’ [-Wunused-variable] rtld.c:1435:3: warning: implicit declaration of function ‘_dl_discover_osversion’ [-Wimplicit-function-declaration]
2012-03-08Fix 9554ebf2d4da22591e974d3cf2ed09a2b8dbdbd8.Thomas Schwinge1-3/+6
| Invalid timeouts in i386 sem_timedwait. | | We adjusted nwaiters even though this isn't necessary.
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-2/+2
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert62-186/+124
2012-02-08Support crti.S and crtn.S provided directly by architectures.Joseph Myers1-3/+0
2012-02-03Consistently use macros for x86 PIC thunks.Joseph Myers6-61/+15
2011-11-30Handle EAGAIN from FUTEX_WAIT_REQUEUE_PIAndreas Schwab1-0/+80
2011-09-10Remove support for !USE___THREADUlrich Drepper4-50/+20
2010-08-19Fix x86 pthread_cond_signal() FUTEX_WAKE_OP fallbackDinakar Guniguntala1-2/+1
2010-08-15Add -fno-asynchronous-unwind-tables to initfini.s for i386H.J. Lu1-0/+3
2010-07-01Work around kernel rejecting valid absolute timestampsAndreas Schwab1-1/+7
2010-01-15Fix pthread_cond_*wait with requeue-PI on i386.Michal Schmidt2-11/+11
2009-12-13More whitespace fixes.Ulrich Drepper1-2/+2
2009-12-13Fix whitespaces.Ulrich Drepper2-6/+6
2009-12-13Add Requeue-PI support for x86 arch.Dinakar Guniguntala5-28/+187
2009-12-12Invalid timeouts in i386 sem_timedwait.Ulrich Drepper1-9/+9
We adjusted nwaiters even though this isn't necessary.
2009-11-22Use #include instead of duplication for i386 vs i686 dl-sysdep.h in NPTL.Roland McGrath1-50/+5
2009-11-18Minor optimizations and cleanups of x86 cond_broadcast.Ulrich Drepper2-11/+10
2009-11-18Update cfi offsets for pthread_cond_broadcast and signal fir x86.Dinakar Guniguntala2-38/+16
2009-11-17Use cfi directives in x86 pthread_cond_{,timed}wait.Ulrich Drepper2-344/+133
2009-06-11Fix futex syscall parameter for x86 absolute timeout waits.Bryan Kadzban1-1/+1
This affects only installations compiled for kernels older than 2.6.18.
2009-01-03(__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_READTIME instead ↵Ulrich Drepper1-19/+79
of computing relative timeout.
2009-01-03* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: DefineUlrich Drepper1-1/+4
FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY. * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2008-12-03* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): RecognizeUlrich Drepper1-2/+4
ESRCH return value. (_nss_dns_gethostbyname4_r): Likewise. * resolv/res_init.c (__res_vinit): Initialize nscount to zero. * sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use gethostbyname4_r, we don't have a separate IPv6 status, so copy the no_data variable.
2008-09-23* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock, Andreas Jaeger1-9/+10
lll_robust_lock, lll_cond_lock, lll_robust_cond_lock, lll_timedlock, lll_robust_timedlock, lll_unlock, lll_robust_unlock): Promote private to int. 2008-09-08 Richard Guenther <rguenther@suse.de> * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock, lll_robust_lock, lll_cond_lock, lll_robust_cond_lock, lll_timedlock, lll_robust_timedlock, lll_unlock, lll_robust_unlock): Promote private to int.
2008-05-27Remove useless more "if" tests before "free".Ulrich Drepper9-2/+183
* include/inline-hashtab.h (htab_delete): Likewise. * libio/freopen.c (freopen): Likewise. * libio/freopen64.c (freopen64): Likewise. * locale/programs/ld-collate.c (collate_read): Likewise. * misc/fstab.c (libc_freeres_fn): Likewise. * posix/glob.c (globfree): Likewise.
2008-05-11* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: AccessUlrich Drepper5-19/+19
__pshared correctly. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise. Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.