public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 0/5] Linux: Fall back to mmap if early sbrk fails
Date: Mon, 02 May 2022 21:15:27 +0200	[thread overview]
Message-ID: <cover.1651518694.git.fweimer@redhat.com> (raw)

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


             reply	other threads:[~2022-05-02 19:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 19:15 Florian Weimer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1651518694.git.fweimer@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).