Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1202095 > unrolled thread

[PATCH] x86/vdso: Emit a GNU hash

Started byAndy Lutomirski <luto@kernel.org>
First post2015-08-06 23:50 +0200
Last post2015-08-09 12:30 +0200
Articles 6 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/vdso: Emit a GNU hash Andy Lutomirski <luto@kernel.org> - 2015-08-06 23:50 +0200
    Re: [PATCH] x86/vdso: Emit a GNU hash Andy Lutomirski <luto@amacapital.net> - 2015-08-07 01:00 +0200
      [PATCH] s390/vdso: emit a GNU hash Martin Schwidefsky <schwidefsky@de.ibm.com> - 2015-08-07 09:10 +0200
      Re: [PATCH] x86/vdso: Emit a GNU hash Nathan Lynch <Nathan_Lynch@mentor.com> - 2015-08-07 18:20 +0200
        Re: [PATCH] x86/vdso: Emit a GNU hash Andy Lutomirski <luto@amacapital.net> - 2015-08-07 20:20 +0200
    [tip:x86/asm] x86/vdso: Emit a GNU hash tip-bot for Andy Lutomirski <tipbot@zytor.com> - 2015-08-09 12:30 +0200

#1202095 — [PATCH] x86/vdso: Emit a GNU hash

FromAndy Lutomirski <luto@kernel.org>
Date2015-08-06 23:50 +0200
Subject[PATCH] x86/vdso: Emit a GNU hash
Message-ID<pUBcZ-4BZ-1@gated-at.bofh.it>
From: Andy Lutomirski <luto@amacapital.net>

Some dynamic loaders may be slightly faster if a GNU hash is
available.  Strangely, this seems to have no effect at all on the
vdso size.

This is unlikely to have any measurable effect on the time it takes
to resolve vdso symbols (since there are so few of them).  In some
contexts, it can be a win for a different reason: if every DSO has a
GNU hash section, then libc can avoid calculating SysV hashes at
all.  Both musl and glibc appear to have this optimization.

It's plausible that this breaks some ancient glibc version.  If so,
then, depending on what glibc versions break, we could either
require COMPAT_VDSO for them or consider reverting.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---

For review.  I'll add it to my (currently empty) 4.3 pull request if
people like it, unless Ingo feels like adding it to -tip directly.

 arch/x86/entry/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index e97032069f88..20f3ac53148d 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -175,7 +175,7 @@ quiet_cmd_vdso = VDSO    $@
 		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
 		 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
 
-VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
+VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
 	$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
 GCOV_PROFILE := n
 
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1202142

FromAndy Lutomirski <luto@amacapital.net>
Date2015-08-07 01:00 +0200
Message-ID<pUCiJ-68K-1@gated-at.bofh.it>
In reply to#1202095
[adding lots of cc's]

On Thu, Aug 6, 2015 at 2:45 PM, Andy Lutomirski <luto@kernel.org> wrote:
> From: Andy Lutomirski <luto@amacapital.net>
>
> Some dynamic loaders may be slightly faster if a GNU hash is
> available.  Strangely, this seems to have no effect at all on the
> vdso size.
>
> This is unlikely to have any measurable effect on the time it takes
> to resolve vdso symbols (since there are so few of them).  In some
> contexts, it can be a win for a different reason: if every DSO has a
> GNU hash section, then libc can avoid calculating SysV hashes at
> all.  Both musl and glibc appear to have this optimization.
>
> It's plausible that this breaks some ancient glibc version.  If so,
> then, depending on what glibc versions break, we could either
> require COMPAT_VDSO for them or consider reverting.
>

Adding lots of arch vdso people.

I think this would be a good thing to do in general.  Want to update
your arches (powerpc, arm(64), s390, tile, and hexagon -- did I miss
any?)?

--Andy

> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> ---
>
> For review.  I'll add it to my (currently empty) 4.3 pull request if
> people like it, unless Ingo feels like adding it to -tip directly.
>
>  arch/x86/entry/vdso/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
> index e97032069f88..20f3ac53148d 100644
> --- a/arch/x86/entry/vdso/Makefile
> +++ b/arch/x86/entry/vdso/Makefile
> @@ -175,7 +175,7 @@ quiet_cmd_vdso = VDSO    $@
>                        -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
>                  sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
>
> -VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
> +VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
>         $(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
>  GCOV_PROFILE := n
>
> --
> 2.4.3
>



-- 
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202328 — [PATCH] s390/vdso: emit a GNU hash

FromMartin Schwidefsky <schwidefsky@de.ibm.com>
Date2015-08-07 09:10 +0200
Subject[PATCH] s390/vdso: emit a GNU hash
Message-ID<pUJWW-zH-21@gated-at.bofh.it>
In reply to#1202142
From 9a3d93634bd74b07a988fa0fc729d1f711253a91 Mon Sep 17 00:00:00 2001
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Date: Fri, 7 Aug 2015 08:55:48 +0200
Subject: [PATCH] s390/vdso: emit a GNU hash

As proposed by Andy Lutomirski create the SysV and the GNU hash
for the vdso objects. This may make some dynamic loaders a bit
faster.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
 arch/s390/kernel/vdso32/Makefile | 2 +-
 arch/s390/kernel/vdso64/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile
index 8ad2b34..ee8a18e 100644
--- a/arch/s390/kernel/vdso32/Makefile
+++ b/arch/s390/kernel/vdso32/Makefile
@@ -13,7 +13,7 @@ KBUILD_AFLAGS_31 += -m31 -s
 KBUILD_CFLAGS_31 := $(filter-out -m64,$(KBUILD_CFLAGS))
 KBUILD_CFLAGS_31 += -m31 -fPIC -shared -fno-common -fno-builtin
 KBUILD_CFLAGS_31 += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
-			$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+			$(call cc-ldoption, -Wl$(comma)--hash-style=both)
 
 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_31)
 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_31)
diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile
index 2a8ddfd..c4b03f9 100644
--- a/arch/s390/kernel/vdso64/Makefile
+++ b/arch/s390/kernel/vdso64/Makefile
@@ -13,7 +13,7 @@ KBUILD_AFLAGS_64 += -m64 -s
 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
 KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
 KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
-			$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+			$(call cc-ldoption, -Wl$(comma)--hash-style=both)
 
 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)
-- 
2.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202858

FromNathan Lynch <Nathan_Lynch@mentor.com>
Date2015-08-07 18:20 +0200
Message-ID<pUSxb-4FO-7@gated-at.bofh.it>
In reply to#1202142
On 08/06/2015 05:52 PM, Andy Lutomirski wrote:
> [adding lots of cc's]
> 
> On Thu, Aug 6, 2015 at 2:45 PM, Andy Lutomirski <luto@kernel.org> wrote:
>> From: Andy Lutomirski <luto@amacapital.net>
>>
>> Some dynamic loaders may be slightly faster if a GNU hash is
>> available.  Strangely, this seems to have no effect at all on the
>> vdso size.

FWIW, I see arch/x86/entry/vdso/vdso64.so increase by 168 bytes here,
using GCC 4.9.2, Binutils 2.24 as packaged by Fedora 21.

I see a similar increase when I make the equivalent change for ARM.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202983

FromAndy Lutomirski <luto@amacapital.net>
Date2015-08-07 20:20 +0200
Message-ID<pUUpk-7nO-19@gated-at.bofh.it>
In reply to#1202858
On Fri, Aug 7, 2015 at 9:10 AM, Nathan Lynch <Nathan_Lynch@mentor.com> wrote:
> On 08/06/2015 05:52 PM, Andy Lutomirski wrote:
>> [adding lots of cc's]
>>
>> On Thu, Aug 6, 2015 at 2:45 PM, Andy Lutomirski <luto@kernel.org> wrote:
>>> From: Andy Lutomirski <luto@amacapital.net>
>>>
>>> Some dynamic loaders may be slightly faster if a GNU hash is
>>> available.  Strangely, this seems to have no effect at all on the
>>> vdso size.
>
> FWIW, I see arch/x86/entry/vdso/vdso64.so increase by 168 bytes here,
> using GCC 4.9.2, Binutils 2.24 as packaged by Fedora 21.
>
> I see a similar increase when I make the equivalent change for ARM.
>
>

At least on my configuration, that doesn't push it across a page
boundary, so it doesn't really matter.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1203616 — [tip:x86/asm] x86/vdso: Emit a GNU hash

Fromtip-bot for Andy Lutomirski <tipbot@zytor.com>
Date2015-08-09 12:30 +0200
Subject[tip:x86/asm] x86/vdso: Emit a GNU hash
Message-ID<pVw1z-38Q-1@gated-at.bofh.it>
In reply to#1202095
Commit-ID:  6b7e26547fad7ace3dcb27a5babd2317fb9d1e12
Gitweb:     http://git.kernel.org/tip/6b7e26547fad7ace3dcb27a5babd2317fb9d1e12
Author:     Andy Lutomirski <luto@amacapital.net>
AuthorDate: Thu, 6 Aug 2015 14:45:45 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 8 Aug 2015 10:42:07 +0200

x86/vdso: Emit a GNU hash

Some dynamic loaders may be slightly faster if a GNU hash is
available.  Strangely, this seems to have no effect at all on
the vdso size.

This is unlikely to have any measurable effect on the time it
takes to resolve vdso symbols (since there are so few of them).
In some contexts, it can be a win for a different reason: if
every DSO has a GNU hash section, then libc can avoid
calculating SysV hashes at all.  Both musl and glibc appear to
have this optimization.

It's plausible that this breaks some ancient glibc version.  If
so, then, depending on what glibc versions break, we could
either require COMPAT_VDSO for them or consider reverting.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Isaac Dunham <ibid.ag@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nathan Lynch <nathan_lynch@mentor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: musl@lists.openwall.com <musl@lists.openwall.com>
Link: http://lkml.kernel.org/r/fd56cc057a2d62ab31c56a48d04fccb435b3fd4f.1438897382.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 96c0617..a3d0767 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -175,7 +175,7 @@ quiet_cmd_vdso = VDSO    $@
 		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
 		 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
 
-VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
+VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
 	$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
 GCOV_PROFILE := n
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web