public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Linux: Fall back to mmap if early sbrk fails
@ 2022-05-02 19:15 Florian Weimer
  2022-05-02 19:15 ` [PATCH 1/5] Linux: Implement a useful version of _startup_fatal Florian Weimer
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Florian Weimer @ 2022-05-02 19:15 UTC (permalink / raw)
  To: libc-alpha

This series implements a _dl_early_allocate function that does not need
a TCB.  It prefers sbrk over mmap to avoid creating too many PTE, but it
can use mmap as well.

Tested on aarch64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
s390x-linux-gnu, x86_64-linux-gnu.  Built with build-many-glibcs.py.

I manually used strace to inject an brk failure, and it mmap fallback
kicks in.

Thanks,
Florian

Florian Weimer (5):
  Linux: Implement a useful version of _startup_fatal
  Linux: Define MMAP_CALL_INTERNAL
  i386: Remove OPTIMIZE_FOR_GCC_5 from Linux libc-do-syscall.S
  i386: Honor I386_USE_SYSENTER for 6-argument Linux system calls
  csu: Implement and use _dl_early_allocate during static startup

 csu/libc-tls.c                                | 12 ++-
 elf/Makefile                                  | 19 +++++
 elf/dl-early_allocate.c                       | 30 +++++++
 elf/tst-tls-allocation-failure-static.c       | 31 +++++++
 scripts/tst-elf-edit.py                       | 34 ++++++--
 sysdeps/generic/ldsodefs.h                    |  5 ++
 sysdeps/unix/sysv/linux/dl-early_allocate.c   | 81 +++++++++++++++++++
 sysdeps/unix/sysv/linux/i386/Makefile         |  2 +-
 .../sysv/linux/i386/libc-do-syscall-int80.S   | 25 ++++++
 .../unix/sysv/linux/i386/libc-do-syscall.S    |  3 -
 sysdeps/unix/sysv/linux/i386/startup.h        | 17 +---
 sysdeps/unix/sysv/linux/i386/sysdep.h         | 13 ++-
 sysdeps/unix/sysv/linux/mmap_call.h           | 22 +++++
 sysdeps/unix/sysv/linux/mmap_internal.h       |  6 +-
 .../s390/{mmap_internal.h => mmap_call.h}     | 14 ++--
 sysdeps/unix/sysv/linux/startup.h             | 38 +++++++++
 16 files changed, 309 insertions(+), 43 deletions(-)
 create mode 100644 elf/dl-early_allocate.c
 create mode 100644 elf/tst-tls-allocation-failure-static.c
 create mode 100644 sysdeps/unix/sysv/linux/dl-early_allocate.c
 create mode 100644 sysdeps/unix/sysv/linux/i386/libc-do-syscall-int80.S
 create mode 100644 sysdeps/unix/sysv/linux/mmap_call.h
 rename sysdeps/unix/sysv/linux/s390/{mmap_internal.h => mmap_call.h} (78%)
 create mode 100644 sysdeps/unix/sysv/linux/startup.h


base-commit: d056c212130280c0a54d9a4f72170ec621b70ce5
-- 
2.35.1


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

end of thread, other threads:[~2022-05-04 13:10 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 19:15 [PATCH 0/5] Linux: Fall back to mmap if early sbrk fails Florian Weimer
2022-05-02 19:15 ` [PATCH 1/5] Linux: Implement a useful version of _startup_fatal Florian Weimer
2022-05-02 19:45   ` H.J. Lu
2022-05-02 19:52     ` Florian Weimer
2022-05-02 20:06       ` H.J. Lu
2022-05-02 20:37         ` Florian Weimer
2022-05-03  5:18           ` Florian Weimer
2022-05-03 15:54             ` H.J. Lu
2022-05-03 16:00               ` Florian Weimer
2022-05-03 16:36                 ` H.J. Lu
2022-05-03 16:43                   ` Florian Weimer
2022-05-03 16:46                     ` H.J. Lu
2022-05-03 16:57                       ` Florian Weimer
2022-05-03 17:01                         ` Adhemerval Zanella
2022-05-03 20:16                           ` Florian Weimer
2022-05-02 19:15 ` [PATCH 2/5] Linux: Define MMAP_CALL_INTERNAL Florian Weimer
2022-05-03 18:30   ` Florian Weimer
2022-05-04 13:10     ` Stefan Liebler
2022-05-02 19:15 ` [PATCH 3/5] i386: Remove OPTIMIZE_FOR_GCC_5 from Linux libc-do-syscall.S Florian Weimer
2022-05-02 19:20   ` H.J. Lu
2022-05-02 19:15 ` [PATCH 4/5] i386: Honor I386_USE_SYSENTER for 6-argument Linux system calls Florian Weimer
2022-05-02 19:24   ` H.J. Lu
2022-05-02 19:15 ` [PATCH 5/5] csu: Implement and use _dl_early_allocate during static startup Florian Weimer

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).