This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Andrew Haley <aph at redhat dot com>, David Miller <davem at davemloft dot net>, "Joseph S. Myers" <joseph at codesourcery dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, <libc-ports at sourceware dot org>, GLIBC Devel <libc-alpha at sourceware dot org>, Chris Metcalf <cmetcalf at tilera dot com>
- Date: Thu, 16 Aug 2012 04:39:01 +1200
- Subject: Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- References: <Pine.LNX.4.64.1206282306320.20312@digraph.polyomino.org.uk> <65B470D2-4D01-4BA1-AEC5-A72C0006EA22@codesourcery.com> <20120711081441.73BB22C093@topped-with-meat.com> <20120711.012509.1325789838255235021.davem@davemloft.net> <4FFD3CD9.4030206@redhat.com> <84304C03-6A49-4263-9016-05486EDC0E98@codesourcery.com> <4FFD4114.9000806@redhat.com> <E1DB09C1-0E3E-4088-9793-C0CAB80B5084@codesourcery.com> <20120711112235.B28CA2C099@topped-with-meat.com> <7FBB4F87-9FF3-4239-818F-5A38C8094011@codesourcery.com> <20120725181300.DD1812C0B5@topped-with-meat.com> <36A2FFD8-0C98-4AB6-8C64-2EEC5CC67A63@codesourcery.com> <20120815162637.B74982C0F2@topped-with-meat.com>
On 16/08/2012, at 4:26 AM, Roland McGrath wrote:
>> 2012-07-09 Maxim Kuvyrkov <maxim@codesourcery.com>
>
> The indentation here is funny so I don't know if that's just how you were
> quoting the fragment in the message or if you meant to indent the header
> line in ChangeLog (which you should not). Remember to use the date of
> commit in the header line.
This is just an indentation artifact in git commit log. It will be properly formatted in the actual ChangeLog file.
>
>> * nptl/pthread_spin_lock.c: New file.
>> * nptl/pthread_spin_trylock.c: New file.
>
> These go in nptl/ChangeLog and don't get the "nptl/" prefix.
This I didn't notice. Thanks.
>
>> ports/
>
> These go in the separate ChangeLog.{arm,hppa,m68k,mips} files.
> From the way you quoted the fragments it wasn't clear if that's
> what you meant.
This I know.
>
>> +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
>> +#include_next <nptl/pthread_spin_lock.c>
>
> You don't use #include_next when you're giving the exact full file name
> like this. Just use #include.
The machine-specific pthread_spin_lock.c files go to ports/sysdeps/<machine>/nptl/pthread_spin_lock.c, which comes first in sysdeps search path before the generic nptl/pthread_spin_lock.c. So it is either '#include_next <nptl/pthread_spin_lock.c>' or '#include "../../../../nptl/pthread_spin_lock.c"'. The former looks less ugly than the later.
>
>
> Aside from the log nits, the generic additions look fine to me. You can
> commit those as soon as one of the affected machine's maintainers agrees.
> For each machine, the changes need to be approved by that machine's
> maintainer. I'm not the maintainer for any those machines, but I would be
> inclined to insist that each definition of SPIN_LOCK_READS_BETWEEN_CMPXCHG
> have a comment giving the machine-specific rationale for the choice of value.
> I wouldn't wait for all the machine maintainers before committing the
> generic parts and whichever machine(s) are approved first. Each machine's
> bits can come along later as those approvals arrive.
OK.
Thanks for the review,
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics