Commit graph

3640 commits

Author SHA1 Message Date
Tony Printezis
ee15d1f82f Run single subtest from a test file
Add mechanism to be able to select a test to run from a test file. The test harness will read the JEMALLOC_TEST_NAME env and, if set, it will only run subtests with that name.
2026-02-25 12:23:25 -05:00
Slobodan Predolac
7bf49ca689 Remove prof_threshold built-in event. It is trivial to implement it as user event if needed 2026-02-25 09:06:29 -08:00
Andrei Pechkurov
bee30a9cd3 Fix background thread initialization race 2026-02-21 15:12:42 -08:00
Slobodan Predolac
2fe05dc6b8 Revert "Experimental configuration option for fast path prefetch from cache_bin"
This reverts commit f9fae9f1f8.
2026-02-06 15:30:27 -08:00
Carl Shapiro
5d6efc6f58 Determine the page size on Android from NDK header files
The definition of the PAGE_SIZE macro is used as a signal for a 32-bit
target or a 64-bit target with an older NDK.  Otherwise, a 16KiB page
size is assumed.

Resolves jemalloc/jemalloc#2657
2026-01-21 00:07:58 -08:00
Carl Shapiro
0d7a26e9b6 Remove an incorrect use of the address operator
The address of the local variable created_threads is a different
location than the data it points to.  Incorrectly treating these
values as being the same can cause out-of-bounds writes to the stack.

Resolves #59
2025-12-23 21:59:04 -08:00
Carl Shapiro
7f043becad Use the BRE construct \{1,\} for one or more consecutive matches
This removes duplication introduced by my earlier commit that
eliminating the use of the non-standard "\+" from BREs in the
configure script.
2025-12-23 19:58:35 -08:00
Slobodan Predolac
afce889cc9 [SEC] Make SEC owned by hpa_shard, simplify the code, add stats, lock per bin 2025-12-19 12:51:26 -05:00
Slobodan Predolac
f9c90d5c20 Remove Cirrus CI 2025-12-11 10:33:56 -05:00
Slobodan Predolac
8779a94fad Add a script to generate github actions instead of Travis CI and Cirrus 2025-12-11 10:33:56 -05:00
Guangli Dai
9aaad0544f Add a mallctl for users to get an approximate of active bytes. 2025-12-08 10:47:57 -08:00
Slobodan Predolac
3f1aa90426 [EASY] Extract hpa_central component from hpa source file 2025-12-02 13:20:18 -08:00
Slobodan Predolac
8384b00ebe [EASY] Encapsulate better, do not pass hpa_shard when hooks are enough, move shard independent actions to hpa_utils 2025-12-02 13:20:18 -08:00
Slobodan Predolac
bfb63eaf41 Add experimental_enforce_hugify 2025-11-21 11:30:16 -08:00
Shirui Cheng
f5f0f063c1 move fill/flush pointer array out of tcache.c 2025-11-02 13:46:00 -08:00
Slobodan Predolac
6ced85a8e5 When extracting from central, hugify_eager is different than start_as_huge 2025-10-15 20:27:35 -04:00
guangli-dai
0f8a8d7ebe Refactor init_system_thp_mode and print it in malloc stats. 2025-10-13 16:56:12 -07:00
Slobodan Predolac
832a332c33 Do not release the hpa_shard->mtx when inserting newly retrieved page from central before allocating from it 2025-10-09 15:39:07 -04:00
Carl Shapiro
bfc20f2804 Inline the value of an always false boolean local variable
Next to its use, which is always as an argument, we include the name
of the parameter in a constant.  This completes a partially
implemented cleanup suggested in an earlier commit.
2025-10-07 14:55:36 -07:00
Slobodan Predolac
0669f70b67 [EASY] Spelling in the comments 2025-10-07 14:52:13 -07:00
Slobodan Predolac
9000d6160f Add npurges and npurge_passes to output of pa_benchmark 2025-10-06 10:12:42 -07:00
Slobodan Predolac
a9596253a5 [pa-bench] Add clock to pa benchmark 2025-10-06 10:12:42 -07:00
Slobodan Predolac
f8ef3195e5 [HPA] Add ability to start page as huge and more flexibility for purging 2025-10-06 10:59:43 -04:00
Slobodan Predolac
db943a0d9e Running clang-format on two files 2025-10-06 10:59:43 -04:00
Slobodan Predolac
2bbcb10d10 Revert "Do not dehugify when purging"
This reverts commit 16c5abd1cd.
2025-10-06 10:59:43 -04:00
Slobodan Predolac
b76a7306a8 Revert "Remove an unused function and global variable"
This reverts commit acd85e5359.
2025-10-06 10:59:43 -04:00
guangli-dai
f29cfa8251 Remove Travis Windows CI for now since it has infra failures. 2025-09-17 17:29:38 -07:00
Slobodan Predolac
b7bedaf7a0 [sdt] Add some tracepoints to sec and hpa modules 2025-09-16 16:27:04 -07:00
Carl Shapiro
d74be2ea7c Improve the portability of grep patterns in configure.ac
The configure.ac script uses backslash plus in its grep patterns to
match one or more occurrences.  This is a GNU grep extension to the
Basic Regular Expressions syntax that fails on systems with a more
traditional grep.  This changes fixes grep patterns that use backslash
plus to use a star instead.
2025-09-16 14:35:51 -07:00
guangli-dai
5d18e0b340 Add a page-allocator microbenchmark. 2025-09-16 10:15:04 -04:00
guangli-dai
983773b118 Adding trace analysis in preparation for page allocator microbenchmark. 2025-09-16 10:15:04 -04:00
Carl Shapiro
c0889acb6c Replace an instance of indentation with spaces with tabs 2025-09-12 10:31:54 -07:00
Aurélien Brooke
28fb5fabe7 Add missing thread_event_registry.c to Visual Studio projects
This file was added by b2a35a905f.
2025-09-08 11:52:34 -07:00
lexprfuncall
cdc3b65300 Update config.guess and config.sub to the latest versions
These files need to be refreshed periodically to support new platform
types.

The following command was used to retrieve the updates

curl -L -O https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
curl -L -O https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
2025-08-29 16:25:02 -07:00
Carl Shapiro
218c989047 Always use pthread_equal to compare thread IDs
This change replaces direct comparisons of Pthread thread IDs with
calls to pthread_equal.  Directly comparing thread IDs is neither
portable nor reliable since a thread ID is defined as an opaque type
that can be implemented using a structure.
2025-08-28 14:45:51 -07:00
Slobodan Predolac
d4cde60066 Remove pidfd_open call handling and rely on PIDFD_SELF 2025-08-27 12:44:45 -04:00
lexprfuncall
7dcdafea00 Change the default page size to 64KiB on Aarch64 Linux
This updates the configuration script to set the default page size to
64KiB on Aarch64 Linux.  This is motivated by compatibility as a build
configured for a 64KiB page will work on kernels that use the smaller
4KiB or 16KiB pages, whereas the reverse is not true.

To make the configured page size setting more visible, the script now
displays the page size when printing the configuration results.

Users that want to override the page size in to choose a smaller value
can still do so with the --with-lg-pagesize configuration option.
2025-08-26 18:10:05 -07:00
Slobodan Predolac
88b29da00a [EASY][BUGFIX] Spelling and format 2025-08-23 21:47:21 -07:00
lexprfuncall
f890bbed4a Define malloc_{write,read}_fd as non-inline global functions
The static inline definition made more sense when these functions just
dispatched to a syscall wrapper.  Since they acquired a retry loop, a
non-inline definition makes more sense.
2025-08-23 11:42:23 -04:00
lexprfuncall
6ced4b5afb Handle interruptions and retries of read(2) and write(2) 2025-08-23 11:42:23 -04:00
lexprfuncall
5f06b14d1c Remove an orphaned comment
This was left behind when definitions of malloc_open and malloc_close
were abstracted from code that had followed.
2025-08-23 11:42:23 -04:00
Shirui Cheng
e2da7477f8 Revert PR #2608: Manually revert commits 70c94d..f9c0b5 2025-08-22 21:55:24 -07:00
lexprfuncall
9186700eb3 Fix the compilation check for process madvise
An include of unistd.h is needed to make the declaration of the
syscall function visible to the compiler.  The include of sys/mman.h
is not used at all.
2025-08-21 22:43:02 -07:00
Slobodan Predolac
4f126b47b3 Save and restore errno when calling process_madvise 2025-08-21 16:22:06 -07:00
lexprfuncall
acd85e5359 Remove an unused function and global variable
When the dehugify functionality was retired in an previous commit, a
dehugify-related function and global variable in a test was
accidentally left in-place causing builds that add -Werror to CFLAGS
to fail.
2025-08-21 08:59:37 -07:00
Slobodan Predolac
f9fae9f1f8 Experimental configuration option for fast path prefetch from cache_bin 2025-08-15 16:06:08 -07:00
lexprfuncall
c45b6223e5 Use relaxed atomics to access the process madvise pid fd
Relaxed atomics already provide sequentially consistent access to single
location data structures.
2025-08-13 18:33:27 -07:00
lexprfuncall
16c5abd1cd Do not dehugify when purging
Giving the advice MADV_DONTNEED to a range of virtual memory backed by
a transparent huge page already causes that range of virtual memory to
become backed by regular pages.
2025-08-13 18:31:50 -07:00
lexprfuncall
0d071a086b Fix several spelling errors in comments 2025-08-08 14:12:12 -07:00
Slobodan Predolac
97d25919c3 [process_madvise] Make init lazy so that python tests pass. Reset the pidfd on fork 2025-07-29 15:47:53 -07:00