Qi Wang
9bd8deb260
Fix stats output for opt.lg_extent_max_active_fit.
2018-06-05 10:23:28 -07:00
Qi Wang
d22e150320
Avoid taking extents_muzzy mutex when muzzy is disabled.
...
When muzzy decay is disabled, no need to allocate from extents_muzzy. This
saves us a couple of mutex operations down the extents_alloc path.
2018-05-24 14:40:56 -07:00
David Goldblatt
a7f749c9af
Hooks: Protect against reentrancy.
...
Previously, we made the user deal with this themselves, but that's not good
enough; if hooks may allocate, we should test the allocation pathways down
hooks. If we're doing that, we might as well actually implement the protection
for the user.
2018-05-18 11:43:03 -07:00
David Goldblatt
0379235f47
Tests: Shouldn't be able to change global slowness.
...
This can help ensure that we don't leave slowness changes behind in case of
resource exhaustion.
2018-05-18 11:43:03 -07:00
David Goldblatt
59e371f463
Hooks: Add a hook exhaustion test.
...
When we run out of space in which to store hooks, we should return EAGAIN from
the mallctl, but not otherwise misbehave.
2018-05-18 11:43:03 -07:00
David Goldblatt
bb071db92e
Mallctl: Add experimental.hooks.[install|remove].
2018-05-18 11:43:03 -07:00
David Goldblatt
126e9a84a5
Hooks: move the "extra" pointer into the hook_t itself.
...
This simplifies the mallctl call to install a hook, which should only take a
single argument.
2018-05-18 11:43:03 -07:00
David Goldblatt
cb0707c0fc
Hooks: hook the realloc pathways that move/expand.
2018-05-18 11:43:03 -07:00
David Goldblatt
67270040a5
Hooks: hook the realloc paths that act as pure malloc/free.
2018-05-18 11:43:03 -07:00
David Goldblatt
83e516154c
Hooks: hook the pure-expand function.
2018-05-18 11:43:03 -07:00
David Goldblatt
c154f5881b
Hooks: hook the pure-deallocation functions.
2018-05-18 11:43:03 -07:00
David Goldblatt
226327cf66
Hooks: hook the pure-allocation functions.
2018-05-18 11:43:03 -07:00
David Goldblatt
fe0e399385
Hooks: add an early-exit path for the common no-hook case.
2018-05-18 11:43:03 -07:00
David Goldblatt
5ae6e7cbfa
Add "hook" module.
...
The hook module allows a low-reader-overhead way of finding hooks to invoke and
calling them.
For now, none of the allocation pathways are tied into the hooks; this will come
later.
2018-05-18 11:43:03 -07:00
David Goldblatt
c7a87e0e0b
Rename hooks module to test_hooks.
...
"Hooks" is really the best name for the module that will contain the publicly
exposed hooks. So lets rename the current "hooks" module (that hook external
dependencies, for reentrancy testing) to "test_hooks".
2018-05-18 11:43:03 -07:00
David Goldblatt
e870829e64
TSD: Add the ability to enter a global slow path.
...
This gives any thread the ability to send other threads down slow paths the next
time they fetch tsd.
2018-05-18 11:43:03 -07:00
David Goldblatt
982c10de35
TSD: Make all state access happen through a function.
...
Shortly, tsd state will be atomic and have some complicated enough logic down
the state-setting path that we should be aware of it.
2018-05-18 11:43:03 -07:00
Qi Wang
09edea3f5c
Tweak the format of the per arena summary section.
...
Increase the width to ensure enough space for long running programs.
2018-05-17 12:58:56 -07:00
Qi Wang
312352faa8
Fix background thread index issues with max_background_threads.
2018-05-15 12:25:23 -07:00
Qi Wang
e8a63b87c3
Fix an incorrect assertion.
...
When configured with --with-lg-page, it's possible for the configured page size
to be greater than the system page size, in which case the page address may only
be aligned with the system page size.
2018-05-09 23:52:56 -07:00
Latchesar Ionkov
a32b7bd567
Mallctl: Add arenas.lookup
...
Implement a new mallctl operation that allows looking up the arena a
region of memory belongs to.
2018-05-01 13:14:36 -07:00
Qi Wang
b8f4c730ef
Remove an incorrect assertion.
...
Background threads are created without holding the global background_thread
lock, which mean paused state is possible (and fine).
2018-04-18 14:17:08 -07:00
Qi Wang
dedfeecc4e
Invoke dlsym() on demand.
...
If no lazy lock or background thread is enabled, avoid dlsym pthread_create on
boot.
2018-04-18 11:20:21 -07:00
David Goldblatt
c95284df1a
Avoid a resource leak down extent split failure paths.
...
Previously, we would leak the extent and memory associated with a salvageable
portion of an extent that we were trying to split in three, in the case where
the first split attempt succeeded and the second failed.
2018-04-18 08:19:41 -07:00
Qi Wang
e40b2f75bd
Fix abort_conf processing.
...
When abort_conf is set, make sure we always error out at the end of the options
processing loop.
2018-04-17 18:23:53 -07:00
Qi Wang
0fadf4a2e3
Add UNUSED to avoid compiler warnings.
2018-04-16 13:50:21 -07:00
Qi Wang
3f0dc64c6b
Allow setting extent hooks on uninitialized auto arenas.
...
Setting extent hooks can result in initializing an unused auto arena. This is
useful to install extent hooks on auto arenas from the beginning.
2018-04-11 21:21:54 -07:00
Jason Evans
4937309620
Silence a compiler warning.
2018-04-10 17:59:00 -07:00
Dave Watson
8b14f3abc0
background_thread: add max thread count config
...
Looking at the thread counts in our services, jemalloc's background thread
is useful, but mostly idle. Add a config option to tune down the number of threads.
2018-04-10 14:01:45 -07:00
Rajeev Misra
5f51882a0a
Stack address should not be used for ordering mutexes
2018-04-10 10:16:57 -07:00
Qi Wang
d3e0976a2c
Fix type warning on Windows.
...
Add cast since read / write has unsigned return type on windows.
2018-04-09 16:50:30 -07:00
Qi Wang
4df483f0fd
Fix arguments passed to extent_init.
2018-04-09 16:35:58 -07:00
Qi Wang
2dccf45640
Control idump and gdump with prof_active.
2018-04-09 16:35:14 -07:00
Dave Watson
6d02421730
extents: Remove preserve_lru feature.
...
preserve_lru feature adds lots of complication, for little value.
Removing it means merged extents are re-added to the lru list, and may
take longer to madvise away than they otherwise would.
Canaries after removal seem flat for several services (no change).
2018-04-02 12:40:28 -07:00
Qi Wang
21eb0d15a6
Fix a background_thread shutdown issue.
...
1) make sure background thread 0 is always created; and 2) fix synchronization
between thread 0 and the control thread.
2018-04-02 10:03:47 -07:00
Qi Wang
956c4ad6b5
Change mutable option output in stats to avoid stringify issues.
2018-03-15 14:42:48 -07:00
Qi Wang
baffeb1d0a
Fix a typo in stats.
2018-03-15 14:42:48 -07:00
David Goldblatt
4c36cd2cc5
Stats printing: Convert arena large stats to use emitter.
...
This completes the conversion; we now have only structured text output.
2018-03-09 11:47:17 -08:00
David Goldblatt
4eed989bbf
Stats printing: convert arena bin stats to use emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
a9f3cedc6e
Stats printing: remove a spurious newline.
...
This was left over from a previous emitter conversion. It didn't affect the
correctness of the output.
2018-03-09 11:47:17 -08:00
David Goldblatt
a1738f4efd
Stats printing: Make arena mutex stats use the emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
07fb707623
Stats printing: convert most per-arena stats to use the emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
8fc850695d
Stats printing: convert paging and alloc counts to use the emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
bc6620f73e
Stats printing: convert decay stats to use the emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
a6ef061c43
Stats printing: Move emitter cutoff point into stats_arena_print.
2018-03-09 11:47:17 -08:00
David Goldblatt
cbde666d9a
Stats printing: move stats_print_helper to use emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
86c61d4a57
Stats printing: Move global mutex stats to use emitter.
2018-03-09 11:47:17 -08:00
David Goldblatt
9e1846b004
Stats printing: move non-mutex arena stats to the emitter.
...
Another step in the conversion process. The mutex is a little different,
because we we want to emit it as an array.
2018-03-09 11:47:17 -08:00
David Goldblatt
8076b28721
Stats printing: Remove explicit callback passing to stats_print_helper.
...
This makes the emitter the only source of callback information, which is a step
towards where we want to be.
2018-03-09 11:47:17 -08:00
David Goldblatt
0d20eda127
Stats printing: Move emitter -> manual cutoff point.
...
This makes it so that the "general" portion of the stats code is completely
agnostic to emitter type.
2018-03-09 11:47:17 -08:00