diff mbox

[5/8] Move i486/pthread_spin_trylock.S to pthread_spin_trylock.S

Message ID CAMe9rOp7zoMCsMLY2WoEucLKkrR6oJZg9XDJa2S-OJmfA08C8A@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Aug. 26, 2015, 7:33 p.m. UTC
On Wed, Aug 26, 2015 at 11:02 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Wed, 26 Aug 2015, H.J. Lu wrote:
>
>> Since glibc doesn't support i386 any more, we can move
>> i486/pthread_spin_trylock.S to pthread_spin_trylock.S
>
> The i686 version wasn't just a #include - you're losing the HAVE_CMOV
> define in this patch.
>
> This illustrates the use of testing these patches by making sure that
> stripped installed shared libraries (for each of i486, i586 and i686) are
> identical before and after the patch series.
>

Here is the updated patch.  There are no changes in generated
shared libraries for i486, i586 amd i686 targets.

OK for master?

Comments

Torvald Riegel Aug. 26, 2015, 8:56 p.m. UTC | #1
On Wed, 2015-08-26 at 12:33 -0700, H.J. Lu wrote:
> On Wed, Aug 26, 2015 at 11:02 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> > On Wed, 26 Aug 2015, H.J. Lu wrote:
> >
> >> Since glibc doesn't support i386 any more, we can move
> >> i486/pthread_spin_trylock.S to pthread_spin_trylock.S
> >
> > The i686 version wasn't just a #include - you're losing the HAVE_CMOV
> > define in this patch.
> >
> > This illustrates the use of testing these patches by making sure that
> > stripped installed shared libraries (for each of i486, i586 and i686) are
> > identical before and after the patch series.
> >
> 
> Here is the updated patch.  There are no changes in generated
> shared libraries for i486, i586 amd i686 targets.
> 
> OK for master?
> 

Could you instead please try to replace the custom asm implementation
with a C implementation, preferably the generic one in
nptl/pthread_spin_trylock.c?  And, if necessary, and improve the latter
if there is a significant performance difference for uncontended locks?

Thanks!
Roland McGrath Aug. 26, 2015, 9:01 p.m. UTC | #2
> Could you instead please try to replace the custom asm implementation
> with a C implementation, preferably the generic one in
> nptl/pthread_spin_trylock.c?  And, if necessary, and improve the latter
> if there is a significant performance difference for uncontended locks?

As I just said in another thread, meaningful changes such as that should
not be conflated with the mechanical directory restructuring HJ is doing
now.  Of course, doing removals first reduces the number of renamings
required.  But the directory restructuring is entirely mechanical and so
its review can consist of verifying that nothing materially changed in the
build whatsoever.  Meaningful changes require meaningful review.

Directory restructuring changes, when generally desireable, should never be
gated on unrelated meaningful changes.  So if HJ wants to do those
meaningful improvements first, that's fine.  But nobody should be objecting
to the directory restructuring changes on the grounds that some other
meaningful change is also desireable.
Carlos O'Donell Aug. 26, 2015, 9:06 p.m. UTC | #3
On 08/26/2015 05:01 PM, Roland McGrath wrote:
>> Could you instead please try to replace the custom asm implementation
>> with a C implementation, preferably the generic one in
>> nptl/pthread_spin_trylock.c?  And, if necessary, and improve the latter
>> if there is a significant performance difference for uncontended locks?
> 
> As I just said in another thread, meaningful changes such as that should
> not be conflated with the mechanical directory restructuring HJ is doing
> now.  Of course, doing removals first reduces the number of renamings
> required.  But the directory restructuring is entirely mechanical and so
> its review can consist of verifying that nothing materially changed in the
> build whatsoever.  Meaningful changes require meaningful review.
> 
> Directory restructuring changes, when generally desireable, should never be
> gated on unrelated meaningful changes.  So if HJ wants to do those
> meaningful improvements first, that's fine.  But nobody should be objecting
> to the directory restructuring changes on the grounds that some other
> meaningful change is also desireable.

+1

c.
Torvald Riegel Aug. 26, 2015, 9:07 p.m. UTC | #4
On Wed, 2015-08-26 at 14:01 -0700, Roland McGrath wrote:
> > Could you instead please try to replace the custom asm implementation
> > with a C implementation, preferably the generic one in
> > nptl/pthread_spin_trylock.c?  And, if necessary, and improve the latter
> > if there is a significant performance difference for uncontended locks?
> 
> As I just said in another thread, meaningful changes such as that should
> not be conflated with the mechanical directory restructuring HJ is doing
> now.  Of course, doing removals first reduces the number of renamings
> required.  But the directory restructuring is entirely mechanical and so
> its review can consist of verifying that nothing materially changed in the
> build whatsoever.  Meaningful changes require meaningful review.
> 
> Directory restructuring changes, when generally desireable, should never be
> gated on unrelated meaningful changes.  So if HJ wants to do those
> meaningful improvements first, that's fine.  But nobody should be objecting
> to the directory restructuring changes on the grounds that some other
> meaningful change is also desireable.
> 

I don't disagree with that -- I simply hadn't paid attention to the
wider set of changes, and moving the file around seemed like a good
opportunity to try to get rid of custom asm.
Roland McGrath Aug. 26, 2015, 9:11 p.m. UTC | #5
> I don't disagree with that -- I simply hadn't paid attention to the
> wider set of changes, and moving the file around seemed like a good
> opportunity to try to get rid of custom asm.

It is indeed a good reminder to look at such files and think about removing
them.  If you proposed patches to remove some such files right now, they
would probably get consensus very quickly.
diff mbox

Patch

From 58710b3f4274f6632eb8a1bd3c719a9f924fcb63 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 26 Aug 2015 09:58:51 -0700
Subject: [PATCH 5/8] Move i486/pthread_spin_trylock.S to
 pthread_spin_trylock.S

Since glibc doesn't support i386 any more, we can move
i486/pthread_spin_trylock.S to pthread_spin_trylock.S

	* sysdeps/i386/i486/pthread_spin_trylock.S: Moved to ...
	* sysdeps/i386/pthread_spin_trylock.S: Here.
	* sysdeps/i386/i586/pthread_spin_trylock.S: Removed.
	* sysdeps/i386/i686/pthread_spin_trylock.S: Updated.
---
 sysdeps/i386/i586/pthread_spin_trylock.S       | 1 -
 sysdeps/i386/i686/pthread_spin_trylock.S       | 2 +-
 sysdeps/i386/{i486 => }/pthread_spin_trylock.S | 0
 3 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 sysdeps/i386/i586/pthread_spin_trylock.S
 rename sysdeps/i386/{i486 => }/pthread_spin_trylock.S (100%)

diff --git a/sysdeps/i386/i586/pthread_spin_trylock.S b/sysdeps/i386/i586/pthread_spin_trylock.S
deleted file mode 100644
index 0cf8b3a..0000000
--- a/sysdeps/i386/i586/pthread_spin_trylock.S
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/i386/i486/pthread_spin_trylock.S>
diff --git a/sysdeps/i386/i686/pthread_spin_trylock.S b/sysdeps/i386/i686/pthread_spin_trylock.S
index 924c4d7..9da05ee 100644
--- a/sysdeps/i386/i686/pthread_spin_trylock.S
+++ b/sysdeps/i386/i686/pthread_spin_trylock.S
@@ -17,4 +17,4 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #define HAVE_CMOV	1
-#include <sysdeps/i386/i486/pthread_spin_trylock.S>
+#include <sysdeps/i386/pthread_spin_trylock.S>
diff --git a/sysdeps/i386/i486/pthread_spin_trylock.S b/sysdeps/i386/pthread_spin_trylock.S
similarity index 100%
rename from sysdeps/i386/i486/pthread_spin_trylock.S
rename to sysdeps/i386/pthread_spin_trylock.S
-- 
2.4.3