This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] S390: Test if lock is free before using atomic instruction in spin-lock.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 16 Dec 2016 20:21:26 +0100
- Subject: Re: [PATCH 2/2] S390: Test if lock is free before using atomic instruction in spin-lock.
- Authentication-results: sourceware.org; auth=none
- References: <1479913753-20506-1-git-send-email-stli@linux.vnet.ibm.com> <1479913753-20506-2-git-send-email-stli@linux.vnet.ibm.com> <1479992650.7146.1535.camel@localhost.localdomain> <b493ee72-62f6-e630-1dfa-5a2f678cf481@linux.vnet.ibm.com> <6fd3b12b-ea5d-7806-b81a-641f6197a685@linux.vnet.ibm.com>
On Fri, 2016-12-16 at 18:08 +0100, Stefan Liebler wrote:
> > What is your suggestion, how to proceed with the volatile int type in
> > conjunction with the atomic-macros?
Good catch re volatile. It should not be volatile, which is consistent
with how we do atomics elsewhere. We shouldn't change the user-facing
type, but should cast to non-volatile internally.
> This patch is not needed anymore as I've posted an adjusted generic
> spinlock code:
> [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.
> https://www.sourceware.org/ml/libc-alpha/2016-12/msg00617.html
>
> [PATCH 2/2] S390: Use generic spinlock code.
> https://www.sourceware.org/ml/libc-alpha/2016-12/msg00618.html
>
> Please have a look.
I'll do. Thanks.