[PATCH] Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.

Stefan Liebler stli@linux.vnet.ibm.com
Tue Dec 13 08:55:00 GMT 2016


Hi,

the macros lll_trylock, lll_cond_trylock are extended by a
__glibc_unlikely hint. Now the trylock macros are based on the
same assumption about a free/busy lock as lll_lock.
With the hint gcc emits code in e.g. pthread_mutex_trylock which does
not use jumps if the lock is free.  Without the hint it had to jump away
if the lock is free.

Tested on s390x, ppc.

Okay to commit?

Bye
Stefan

ChangeLog:

	* sysdeps/nptl/lowlevellock.h (lll_trylock, lll_cond_trylock):
	Add __glibc_unlikely hint.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lll_trylock.patch
Type: text/x-patch
Size: 1694 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20161213/fbda2af1/attachment.bin>


More information about the Libc-alpha mailing list