This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Mon, 6 Feb 2017 14:03:59 +0530
- Subject: Re: [PATCH] Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock.
- Authentication-results: sourceware.org; auth=none
- References: <4adc080f-9975-4ee0-003e-675f3c9f1203@linux.vnet.ibm.com>
On Tuesday 13 December 2016 02:24 PM, Stefan Liebler wrote:
> 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?
Yes, looks good.
Siddhesh