diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-08-27 13:04:18 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-08-27 13:07:09 +0000 |
commit | 921e251e8f364d00fc753274095007275381ae65 (patch) | |
tree | 8dc46c3b8dccb669cdfceb7284991d131d180c3e /sysdeps/unix/bsd/osf | |
parent | 614cfd0f8a2820aed54f9745077c7da0e6643bac (diff) | |
download | glibc-921e251e8f364d00fc753274095007275381ae65.zip glibc-921e251e8f364d00fc753274095007275381ae65.tar.gz glibc-921e251e8f364d00fc753274095007275381ae65.tar.bz2 |
malloc: Support hugepages in mremap_chunk
Add mremap_chunk support for mmap()ed chunks using hugepages by accounting for
their alignment, to prevent the mremap call failing in most cases where the
size passed is not a hugepage size multiple. It also improves robustness for
reallocating hugepages since mremap is much less likely to fail, so running
out of memory when reallocating a larger size and having to copy the old
contents after mremap fails is also less likely.
To track whether an mmap()ed chunk uses hugepages, have a flag in the lowest
bit of the mchunk_prev_size field which is set after a call to sysmalloc_mmap,
and accessed later in mremap_chunk. Create macros for getting and setting this
bit, and for mapping the bit off when accessing the field for mmap()ed chunks.
Since the alignment cannot be lower than 8 bytes, this flag cannot affect the
alignment data.
Add malloc/tst-tcfree4-malloc-check to the tests-exclude-malloc-check list as
malloc-check prevents the tcache from being used to store chunks. This test
caused failures due to a bug in mem2chunk_check to be fixed in a later patch.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/bsd/osf')
0 files changed, 0 insertions, 0 deletions