diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-06-16 21:53:51 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-06-16 21:53:51 +0000 |
| commit | 3e4bd977b7688db3713ceca1e2a24f88a62ef04b (patch) | |
| tree | a9b5cc54f1d727247b2c32d68543d94f3996b539 /libexec | |
| parent | b32abae98b2f3c8be03dcc58ce9d5116aa8b2695 (diff) | |
ld.elf_so(1): Omit needless membar_enter.
The use of membar_enter is to separate atomic r/m/w on a lock from
the body of the critical section so two different critical sections
happen in order:
body of previous critical section;
exit critical section:
membar_exit();
atomic_r/m/w(lock stuff);
enter critical section:
atomic_r/m/w(lock stuff);
membar_enter();
body of next critical section;
_rtld_shared_enter does this, but it _also_ issued an extraneous
membar_enter before the atomic_r/m/w part, which doesn't impose any
semantically important order but may cost some performance.
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ld.elf_so/rtld.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libexec/ld.elf_so/rtld.c b/libexec/ld.elf_so/rtld.c index 69610001383..a23bcfe24dc 100644 --- a/libexec/ld.elf_so/rtld.c +++ b/libexec/ld.elf_so/rtld.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.208 2021/05/30 02:26:08 joerg Exp $ */ +/* $NetBSD: rtld.c,v 1.209 2021/06/16 21:53:51 riastradh Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.208 2021/05/30 02:26:08 joerg Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.209 2021/06/16 21:53:51 riastradh Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -1673,8 +1673,6 @@ _rtld_shared_enter(void) unsigned int cur; lwpid_t waiter, self = 0; - membar_enter(); - for (;;) { cur = _rtld_mutex; /* |
