This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Cc: szabolcs dot nagy at arm dot com, marcus dot shawcroft at gmail dot com, pb at pbcl dot net, "Joseph S. Myers" <joseph at codesourcery dot com>, rth at twiddle dot net, "Carlos O'Donell" <carlos at redhat dot com>, vapier at gentoo dot org, schwab at suse dot de, cmetcalf at mellanox dot com, david at holsgrove dot tech, chunglin_tang at mentor dot com, munroesj at linux dot vnet dot ibm dot com, davem at davemloft dot net, cmetcalf at mellanox dot com
- Cc:
- Date: Tue, 30 May 2017 17:59:12 -0300
- Subject: Re: [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.
- Authentication-results: sourceware.org; auth=none
- References: <1481905917-15654-1-git-send-email-stli@linux.vnet.ibm.com> <5857CF10.1060100@arm.com> <628f6311-239c-5eea-572c-c2acae6fcbee@linux.vnet.ibm.com> <1487017743.16322.80.camel@redhat.com> <60a34645-17e4-6693-1343-03c55b0c47ad@linux.vnet.ibm.com> <1487437038.20203.68.camel@redhat.com> <25ad863b-6f20-bfb7-95e6-3b04a2b3eee8@linux.vnet.ibm.com> <1487598702.20203.138.camel@redhat.com> <b57d3477-a041-7b06-82ac-6d2b6c6bb08c@linux.vnet.ibm.com> <1491487245.5374.161.camel@redhat.com> <09ae8ea7-4119-76c1-cd58-36cbdf587390@linux.vnet.ibm.com>
Stefan Liebler <stli@linux.vnet.ibm.com> writes:
> On 04/06/2017 04:00 PM, Torvald Riegel wrote:
>> Otherwise, this patch looks good to me.
> Thanks for review. Here is an updated patch. I've changed the comments
> and added the POSIX requirement in pthread_spin_trylock.
>
> @architecture maintainers:
> I've added defines of ATOMIC_EXCHANGE_USES_CAS in the architecture
> specific atomic-machine.h files.
> See comment in include/atomic.h:
> /* ATOMIC_EXCHANGE_USES_CAS is equal to 1 if atomic_exchange operations
> are implemented based on a CAS loop; otherwise, this is 0 and we assume
> that the atomic_exchange operations could provide better performance
> than a CAS loop. */
>
> Can review the definition to 0 or 1 in the atomic-machine.h file of your
> architecture, please?
The values look good for powerpc32 and powerpc64.
--
Tulio Magno