public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH htl v3 0/5] Rewrite THREAD_GSCOPE
@ 2021-09-07 13:33 Sergey Bugaev
  2021-09-07 13:33 ` [PATCH htl v3 1/5] elf: Replace most uses of THREAD_GSCOPE_IN_TCB Sergey Bugaev
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Sergey Bugaev @ 2021-09-07 13:33 UTC (permalink / raw)
  To: libc-alpha, bug-hurd; +Cc: samuel.thibault, Sergey Bugaev

Hello,

this is yet another revision of the same patchset to stop issuing many
redundant gsync_wake () calls. Following the brief feedback I got the last
time, it switches most users of THREAD_GSCOPE_IN_TCB to PTHREAD_IN_LIBC, then
actually introduces the new GSCOPE implementation, and then finally drops the
remaining uses of THREAD_GSCOPE_IN_TCB entirely, since it's not always on.

Things still seem to build and work somewhat (tested on GNU/Hurd i686 and
GNU/Linux x86_64). rpctrace uname still shows that there are no more
gsync_wake () calls.

Apparently dlopen (RTLD_GLOBAL) is a good way to trigger THREAD_GSCOPE_WAIT ().
I have written a test program that spawns 100 threads, then each of the threads
dlopen's 100 shared objects, then dlclose's them back. On GNU/Linux, I have
verified with GDB that it hits NPTL's __thread_gscope_wait (). I haven't been
able to verify the same on the Hurd due to the general flakiness of GDB there,
but I have ran the program with the patched glibc multiple times and it doesn't
crash, so I assume it's working fine.

Sergey Bugaev (5):
  elf: Replace most uses of THREAD_GSCOPE_IN_TCB
  htl: Move thread table to ld.so
  htl: Reimplement GSCOPE
  elf: Remove THREAD_GSCOPE_IN_TCB
  testrun.sh: Add support for --tool=rpctrace

 Makefile                                 |  9 +++-
 elf/dl-reloc.c                           |  4 +-
 elf/dl-support.c                         |  3 +-
 elf/dl-tls.c                             |  6 +--
 elf/dl-tls_init_tp.c                     |  2 +-
 htl/Versions                             |  2 -
 htl/pt-alloc.c                           | 50 +++++++++------------
 htl/pt-create.c                          | 11 ++---
 htl/pt-internal.h                        | 23 +++-------
 sysdeps/aarch64/nptl/tls.h               |  1 -
 sysdeps/alpha/nptl/tls.h                 |  1 -
 sysdeps/arc/nptl/tls.h                   |  1 -
 sysdeps/arm/nptl/tls.h                   |  1 -
 sysdeps/csky/nptl/tls.h                  |  1 -
 sysdeps/generic/ldsodefs.h               | 18 +++++---
 sysdeps/generic/tls.h                    |  6 ---
 sysdeps/hppa/nptl/tls.h                  |  1 -
 sysdeps/htl/dl-support.c                 | 23 ++++++++++
 sysdeps/htl/dl-thread_gscope_wait.c      | 55 ++++++++++++++++++++++++
 sysdeps/htl/pt-key-delete.c              |  8 ++--
 sysdeps/htl/pthreadP.h                   |  2 -
 sysdeps/htl/raise.c                      |  8 +++-
 sysdeps/htl/thrd_current.c               |  7 ++-
 sysdeps/i386/nptl/tls.h                  |  1 -
 sysdeps/ia64/nptl/tls.h                  |  1 -
 sysdeps/m68k/nptl/tls.h                  |  1 -
 sysdeps/mach/hurd/htl/pt-sigstate-init.c |  2 +-
 sysdeps/mach/hurd/htl/pt-sysdep.c        |  2 +-
 sysdeps/mach/hurd/htl/pt-sysdep.h        |  2 +-
 sysdeps/mach/hurd/i386/tls.h             | 19 ++++++++
 sysdeps/mach/hurd/tls.h                  | 20 ---------
 sysdeps/microblaze/nptl/tls.h            |  1 -
 sysdeps/mips/nptl/tls.h                  |  1 -
 sysdeps/nios2/nptl/tls.h                 |  1 -
 sysdeps/powerpc/nptl/tls.h               |  1 -
 sysdeps/riscv/nptl/tls.h                 |  1 -
 sysdeps/s390/nptl/tls.h                  |  1 -
 sysdeps/sh/nptl/tls.h                    |  1 -
 sysdeps/sparc/nptl/tls.h                 |  1 -
 sysdeps/x86_64/nptl/tls.h                |  1 -
 40 files changed, 172 insertions(+), 128 deletions(-)
 create mode 100644 sysdeps/htl/dl-support.c
 create mode 100644 sysdeps/htl/dl-thread_gscope_wait.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-09-15 15:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 13:33 [PATCH htl v3 0/5] Rewrite THREAD_GSCOPE Sergey Bugaev
2021-09-07 13:33 ` [PATCH htl v3 1/5] elf: Replace most uses of THREAD_GSCOPE_IN_TCB Sergey Bugaev
2021-09-14 23:30   ` Samuel Thibault
2021-09-07 13:33 ` [PATCH htl v3 2/5] htl: Move thread table to ld.so Sergey Bugaev
2021-09-14 23:27   ` Samuel Thibault
2021-09-15 14:14     ` Sergey Bugaev
2021-09-15 14:34       ` Samuel Thibault
2021-09-15 14:35         ` Samuel Thibault
2021-09-15 15:13         ` Sergey Bugaev
2021-09-15 15:16           ` Samuel Thibault
2021-09-07 13:33 ` [PATCH htl v3 3/5] htl: Reimplement GSCOPE Sergey Bugaev
2021-09-14 23:28   ` Samuel Thibault
2021-09-07 13:33 ` [PATCH htl v3 4/5] elf: Remove THREAD_GSCOPE_IN_TCB Sergey Bugaev
2021-09-14 23:29   ` Samuel Thibault
2021-09-07 13:33 ` [PATCH htl v3 5/5] testrun.sh: Add support for --tool=rpctrace Sergey Bugaev
2021-09-08  6:57   ` Florian Weimer
2021-09-09 23:25     ` Samuel Thibault
2021-09-07 17:05 ` [PATCH htl v3 0/5] Rewrite THREAD_GSCOPE Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).