mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
powerpc: Optimize lock elision for pthread_mutex_t
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.
This commit is contained in:
committed by
Tulio Magno Quites Machado Filho
parent
e5e6bea22a
commit
fadd2ad9cc
@ -47,7 +47,6 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
|
||||
{
|
||||
if (*adapt_count > 0)
|
||||
{
|
||||
(*adapt_count)--;
|
||||
goto use_lock;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user