This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] powerpc: Optimize lock elision for pthread_mutex_t
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, schwab at linux-m68k dot org, "libc-alpha\ at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc:
- Date: Thu, 08 Oct 2015 11:39:26 -0300
- Subject: Re: [PATCH 2/2] powerpc: Optimize lock elision for pthread_mutex_t
- Authentication-results: sourceware.org; auth=none
- References: <55E89415 dot 1020005 at linux dot vnet dot ibm dot com>
"Paul E. Murphy" <murphyp@linux.vnet.ibm.com> writes:
> 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.
>
> 2015-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
> * 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.
LGTM.
I'm pushing it.
Thanks!
--
Tulio Magno